Requests (software)
![]() | |
Original author(s) | Kenneth Reitz |
---|---|
Developer(s) | Kenneth Reitz, Cory Benfield, Ian Stapleton Cordasco, Nate Prewitt |
Initial release | 14 February 2011 |
Stable release | 2.26.0[1] ![]() |
Repository | |
Written in | Python |
License | Apache License 2.0 |
Website | requests![]() |
Requests is a HTTP library for the Python programming language. The goal of the project is to make HTTP requests simpler and more human-friendly. The current version is 2.26.0.[2][3] Requests is released under the Apache License 2.0.
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.[4]
Example code[]
![]() | This section possibly contains original research. (November 2021) |
>>> 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, ...}