Requests (software)
Requests is a Python HTTP library, released under the Apache License 2.0. The goal of the project is to make HTTP requests simpler and more human-friendly. The current version is 2.25.0[1][2]
Original author(s) | Kenneth Reitz |
---|---|
Developer(s) | Kenneth Reitz, Cory Benfield, Ian Stapleton Cordasco, Nate Prewitt |
Initial release | 14 February 2011 |
Stable release | 2.25.0
/ 11 November 2020 |
Repository | |
Written in | Python |
Operating system | Cross-platform |
Platform | Cross-platform |
License | Apache License 2.0 |
Website | requests |
Requests is one of the most popular python libraries that is not included with python, it has been proposed that requests be distributed with python by default.[3]
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.
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
- GitHub - psf/requests: Python HTTP Requests for Humans™ ✨🍰✨., kennethreitz.org, 2020-02-24, retrieved 2020-02-24
- Project homepage
- Beazly, David (April 2012). "R is for replacement" (PDF). ;login:. 37 (Volume 37, Number 2). Retrieved 16 May 2020.CS1 maint: extra punctuation (link)