Requests (software)
   HOME

TheInfoList



OR:

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, ...
library A library is a collection of materials, books or media that are accessible for use and not just for display purposes. A library provides physical (hard copies) or digital access (soft copies) materials, and may be a physical location or a vir ...
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 (pro ...
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