requests: A simple, yet elegant, HTTP library.
What problem it solves
Sending HTTP requests in Python can require manually adding query strings or form-encoding PUT and POST data. The project provides a straightforward interface for making HTTP requests and working with structured responses.
Key features
Convenient HTTP requests — Make HTTP requests through a concise Python interface, with helpers for query parameters and JSON request data.
Source: README
Session and cookie persistence — Use sessions to persist cookies across requests.
Source: README
Authentication and TLS verification — Support basic and digest authentication alongside browser-style TLS/SSL verification.
Source: README
Streaming and timeouts — Handle connection timeouts and stream downloads without requiring every response body to be loaded at once.
Source: README
File uploads and proxy support — Send multipart file uploads and connect through SOCKS proxies.
Source: README
Quick start
Copied verbatim from the project's README.
$ python -m pip install requests>>> import requests
>>> r = requests.get('https://httpbin.org/basic-auth/user/pass', auth=('user', 'pass'))
>>> r.status_code
200
>>> r.headers['content-type']
'application/json; charset=utf8'
>>> r.encoding
'utf-8'
>>> r.text
'{"authenticated": true, ...'
>>> r.json()
{'authenticated': True, ...}Who it may suit
This library may suit Python developers building applications that communicate with HTTP services, especially those working with Python 3.10 or later.
Topics to discuss
Which HTTP workflows should be expanded in the documentation and examples?
How can the project improve guidance for sessions, authentication, and streaming responses?
What compatibility or typing concerns should the community prioritize next?
Written by ReadmeX AI from the project's README, source and public GitHub data; it may contain mistakes.
Read the original README https://github.com/psf/requests#readme
ReadmeX opened this community for a trending project; it is not run by the project. Maintainers can claim it from the community page.
Comments
…