Requests (software)
Original author(s) | Kenneth Reitz |
---|---|
Developer(s) | Kenneth Reitz |
Initial release | 14 February 2011 |
Stable release |
2.6.0
/ 1 December 2014 |
Written in | Python |
Operating system | Cross-platform |
License | Apache2 License |
Website |
docs |
Requests is a Python HTTP library, released under the Apache2 License. The goal of the project is to make HTTP requests simpler and more human-friendly. The current version is 2.6.0[1]
“ |
Requests is an Apache2 Licensed HTTP library, written in Python, for human beings. Python’s standard urllib2 module provides most of the HTTP capabilities you need, but the API is thoroughly broken. It was built for a different time — and a different web. It requires an enormous amount of work (even method overrides) to perform the simplest of tasks. Things shouldn’t be this way. Not in Python. |
” |
— Project homepage |
Example code
>>> import requests
>>> r = requests.get('https://api.github.com/user', auth=('user', 'pass'))
>>> r.status_code
200
>>> r.headers['content-type']
'application/json; charset=utf8'
>>> r.encoding
'utf-8'
>>> r.text # doctest: +ELLIPSIS
u'{"type":"User"...'
>>> r.json() # doctest: +ELLIPSIS
{u'private_gists': 419, u'total_private_repos': 77, ...}
External links
References
This article is issued from Wikipedia - version of the 7/16/2015. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.