Requests is a
HTTP
The Hypertext Transfer Protocol (HTTP) is an application layer protocol in the Internet protocol suite model for distributed, collaborative, hypermedia information systems. HTTP is the foundation of data communication for the World Wide Web, w ...
library for the
Python
Python may refer to:
Snakes
* Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia
** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia
* Python (mythology), a mythical serpent
Computing
* Python (pr ...
programming language. The goal of the project is to make HTTP requests simpler and more human-friendly. The current version is 2.30.0. 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.
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, ...}
References
External links
*
*{{GitHub, psf/requests
Python (programming language) libraries
Free network-related software
Free software programmed in Python
Software using the Apache license