3
[](https://pypi.org/project/requests/)
4
[](https://pypi.org/project/requests)
5
[](https://pepy.tech/project/requests)
6
[](https://github.com/psf/requests/graphs/contributors)
7
[](https://requests.readthedocs.io)
9
**Requests** is a simple, yet elegant, HTTP library.
13
>>> r = requests.get('https://httpbin.org/basic-auth/user/pass', auth=('user', 'pass'))
16
>>> r.headers['content-type']
17
'application/json; charset=utf8'
21
'{"authenticated": true, ...'
23
{'authenticated': True, ...}
26
Requests allows you to send HTTP/1.1 requests extremely easily. There’s no need to manually add query strings to your URLs, or to form-encode your `PUT` & `POST` data — but nowadays, just use the `json` method!
28
Requests is one of the most downloaded Python packages today, pulling in around `300M downloads / week` — according to GitHub, Requests is currently [depended upon](https://github.com/psf/requests/network/dependents?package_id=UGFja2FnZS01NzA4OTExNg%3D%3D) by `4,000,000+` repositories.
26
Requests allows you to send HTTP/1.1 requests extremely easily. There’s no need to manually add query strings to your URLs, or to form-encode your `PUT` & `POST` data — but nowadays, just use the `json` method!
28
Requests is one of the most downloaded Python packages today, pulling in around `300M downloads / week` — according to GitHub, Requests is currently [depended upon](https://github.com/psf/requests/network/dependents?package_id=UGFja2FnZS01NzA4OTExNg%3D%3D) by `4,000,000+` repositories.
30
## Installing Requests and Supported Versions
32
Requests is available on PyPI:
35
$ python -m pip install requests
38
Requests officially supports Python 3.10+.
40
## Supported Features & Best–Practices
42
Requests is ready for the demands of building robust and reliable HTTP–speaking applications, for the needs of today.
44
- Keep-Alive & Connection Pooling
45
- International Domains and URLs
46
- Sessions with Cookie Persistence
47
- Browser-style TLS/SSL Verification
48
- Basic & Digest Authentication
49
- Familiar `dict`–like Cookies
50
- Automatic Content Decompression and Decoding
51
- Multi-part File Uploads
55
- Automatic honoring of `.netrc`
56
- Chunked HTTP Requests
58
## Cloning the repository
60
When cloning the Requests repository, you may need to add the `-c
61
fetch.fsck.badTimezone=ignore` flag to avoid an error about a bad commit timestamp (see
62
[this issue](https://github.com/psf/requests/issues/2690) for more background):
58
## Cloning the repository
60
When cloning the Requests repository, you may need to add the `-c
61
fetch.fsck.badTimezone=ignore` flag to avoid an error about a bad commit timestamp (see
62
[this issue](https://github.com/psf/requests/issues/2690) for more background):
65
git clone -c fetch.fsck.badTimezone=ignore https://github.com/psf/requests.git
68
You can also apply this setting to your global Git config:
71
git config --global fetch.fsck.badTimezone ignore
76
[](https://kennethreitz.org) [](https://www.python.org/psf)