A simple, yet elegant, HTTP library. https://requests.readthedocs.io/en/latest/
  • Python 99.2%
  • Makefile 0.7%
Find a file
root 4faf122f02
All checks were successful
dsci The build status: success
Update .dsci/jobs.yaml
2026-01-19 20:55:27 +03:00
.dsci Update .dsci/jobs.yaml 2026-01-19 20:55:27 +03:00
.github Bump github/codeql-action from 3.30.0 to 4.30.8 2025-10-13 16:16:05 +00:00
docs Add support for Python 3.14 and drop support for Python 3.8 (#6993) 2025-07-25 14:42:15 -06:00
ext The Principle of Polarity 2019-09-23 14:17:08 -04:00
src/requests v2.32.5 2025-08-18 13:23:20 -07:00
tests Add more tests to prevent regression of CVE 2024 47081 2025-06-05 09:55:33 -05:00
.coveragerc Add automatic code formatting to Requests (#6095) 2022-04-29 13:16:58 -06:00
.git-blame-ignore-revs Add .git-blame-ignore-revs 2022-04-29 15:39:22 -06:00
.gitignore Switch LGPL'd chardet for MIT licensed charset_normalizer (#5797) 2021-07-06 18:55:02 -05:00
.pre-commit-config.yaml Pre commit update (#6498) 2023-08-12 12:03:10 -07:00
.readthedocs.yaml docs: specify sphinx dirhtml builder 2023-12-23 16:16:50 +00:00
AUTHORS.rst update authors github link 2024-02-23 10:25:50 +00:00
HISTORY.md v2.32.5 2025-08-18 13:23:20 -07:00
LICENSE Apply the Apache-2.0 license correctly 2020-08-27 09:44:27 -07:00
Makefile Update Makefile rules (#6996) 2025-07-18 10:24:31 -06:00
MANIFEST.in v2.32.1 2024-05-20 15:02:29 -07:00
NOTICE Apply the Apache-2.0 license correctly 2020-08-27 09:44:27 -07:00
pyproject.toml Move to src directory (#6506) 2023-08-13 14:46:13 -07:00
README.md Add support for Python 3.14 and drop support for Python 3.8 (#6993) 2025-07-25 14:42:15 -06:00
requirements-dev.txt upgrade to pytest-httpbin 2.1.0 final 2024-09-18 16:36:43 +01:00
setup.cfg Fix urllib3 pin in setup.cfg (#6545) 2023-10-06 16:34:24 -06:00
setup.py Add support for Python 3.14 and drop support for Python 3.8 (#6993) 2025-07-25 14:42:15 -06:00
tox.ini Add support for Python 3.14 and drop support for Python 3.8 (#6993) 2025-07-25 14:42:15 -06:00

Requests

Requests is a simple, yet elegant, HTTP library.

>>> 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, ...}

Requests allows you to send HTTP/1.1 requests extremely easily. Theres 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!

Requests is one of the most downloaded Python packages today, pulling in around 30M downloads / week— according to GitHub, Requests is currently depended upon by 1,000,000+ repositories. You may certainly put your trust in this code.

Downloads Supported Versions Contributors

Installing Requests and Supported Versions

Requests is available on PyPI:

$ python -m pip install requests

Requests officially supports Python 3.9+.

Supported Features & BestPractices

Requests is ready for the demands of building robust and reliable HTTPspeaking applications, for the needs of today.

  • Keep-Alive & Connection Pooling
  • International Domains and URLs
  • Sessions with Cookie Persistence
  • Browser-style TLS/SSL Verification
  • Basic & Digest Authentication
  • Familiar dictlike Cookies
  • Automatic Content Decompression and Decoding
  • Multi-part File Uploads
  • SOCKS Proxy Support
  • Connection Timeouts
  • Streaming Downloads
  • Automatic honoring of .netrc
  • Chunked HTTP Requests

API Reference and User Guide available on Read the Docs

Read the Docs

Cloning the repository

When cloning the Requests repository, you may need to add the -c fetch.fsck.badTimezone=ignore flag to avoid an error about a bad commit timestamp (see this issue for more background):

git clone -c fetch.fsck.badTimezone=ignore https://github.com/psf/requests.git

You can also apply this setting to your global Git config:

git config --global fetch.fsck.badTimezone ignore

Kenneth Reitz Python Software Foundation