Jump to content

Requests (software)

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by AnomieBOT (talk | contribs) at 00:33, 21 November 2021 (Dating maintenance tags: {{Originalresearch}}). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Requests
Original author(s)Kenneth Reitz
Developer(s)Kenneth Reitz, Cory Benfield, Ian Stapleton Cordasco, Nate Prewitt
Initial releaseError: df must be either "yes" or "y" (help)
Stable release
2.32.3[1] Edit this on Wikidata / 29 May 2024; 12 months ago (29 May 2024)
Repository
Written inPython
LicenseApache License 2.0
Websiterequests.readthedocs.io Edit this at Wikidata

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

>>> 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

  1. ^ "Release 2.32.3". 29 May 2024. Retrieved 24 June 2024.
  2. ^ GitHub - psf/requests: Python HTTP Requests for Humans™ ✨🍰✨., kennethreitz.org, 2020-02-24, retrieved 2020-02-24
  3. ^ Project homepage
  4. ^ Beazly, David (April 2012). "R is for replacement" (PDF). Login. 37 (2). Retrieved 16 May 2020.