requests

Python HTTP for Humans.

Apache-2.0 163 个版本 Python >=3.10
安装
pip install requests
poetry add requests
pipenv install requests
conda install requests
描述

Requests

Version Supported Versions Downloads Contributors Documentation

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

Requests is one of the most downloaded Python packages today, pulling in around 300M downloads / week — according to GitHub, Requests is currently depended upon by 4,000,000+ repositories.

Installing Requests and Supported Versions

Requests is available on PyPI:

$ python -m pip install requests

Requests officially supports Python 3.10+.

Supported Features & Best–Practices

Requests is ready for the demands of building robust and reliable HTTP–speaking 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 dict–like Cookies
  • Automatic Content Decompression and Decoding
  • Multi-part File Uploads
  • SOCKS Proxy Support
  • Connection Timeouts
  • Streaming Downloads
  • Automatic honoring of .netrc
  • Chunked HTTP Requests

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

版本列表
2.34.2 2026-05-14
2.34.1 2026-05-13
2.34.0 2026-05-11
2.34.0.dev1 2026-05-03
2.33.1 2026-03-30
2.33.0 2026-03-25
2.32.5 2025-08-18
2.32.4 2025-06-09
2.32.3 2024-05-29
2.32.2 2024-05-21
2.32.1 2024-05-20
2.32.0 2024-05-20
2.31.0 2023-05-22
2.30.0 2023-05-03
2.29.0 2023-04-26
2.28.2 2023-01-12
2.28.1 2022-06-29
2.28.0 2022-06-09
2.27.1 2022-01-05
2.27.0 2022-01-03
2.26.0 2021-07-13
2.25.1 2020-12-16
2.25.0 2020-11-11
2.24.0 2020-06-17
2.23.0 2020-06-17
2.22.0 2019-05-16
2.21.0 2018-12-10
2.20.1 2018-11-08
2.20.0 2018-10-18
2.19.1 2018-06-14
2.19.0 2018-06-12
2.18.4 2017-08-15
2.18.3 2017-08-02
2.18.2 2017-07-25
2.18.1 2017-06-14
2.18.0 2017-06-14
2.17.3 2017-05-29
2.17.2 2017-05-29
2.17.1 2017-05-29
2.17.0 2017-05-29
2.16.5 2017-05-28
2.16.4 2017-05-27
2.16.3 2017-05-27
2.16.2 2017-05-27
2.16.1 2017-05-27
2.16.0 2017-05-27
2.15.1 2017-05-27
2.14.2 2017-05-10
2.14.1 2017-05-09
2.14.0 2017-05-09
2.13.0 2017-01-24
2.12.5 2017-01-18
2.12.4 2016-12-14
2.12.3 2016-12-01
2.12.2 2016-11-30
2.12.1 2016-11-16
2.12.0 2016-11-15
2.11.1 2016-08-17
2.11.0 2016-08-08
2.10.0 2016-04-29
2.9.2 2016-04-29
2.9.1 2015-12-21
2.9.0 2015-12-15
2.8.1 2015-10-13
2.8.0 2015-10-06
2.7.0 2015-05-03
2.6.2 2015-04-23
2.6.1 2015-04-23
2.6.0 2015-03-14
2.5.3 2015-02-24
2.5.2 2015-02-23
2.5.1 2014-12-23
2.5.0 2014-12-01
2.4.3 2014-10-06
2.4.2 2014-10-05
2.4.1 2014-09-09
2.4.0 2014-08-29
2.3.0 2014-05-16
2.2.1 2014-01-23
2.2.0 2014-01-09
2.1.0 2013-12-05
2.0.1 2013-11-15
2.0.0 2013-11-15
1.2.3 2013-05-25
1.2.2 2013-05-21
1.2.1 2013-05-20
1.2.0 2013-03-31
1.1.0 2013-01-10
1.0.4 2012-12-23
1.0.3 2012-12-18
1.0.2 2012-12-17
1.0.1 2012-12-17
1.0.0 2012-12-17
0.14.2 2012-10-27
0.14.1 2012-10-01
0.14.0 2012-09-02
0.13.9 2012-08-25
0.13.8 2012-08-20
0.13.7 2012-08-19
0.13.6 2012-08-06
0.13.5 2012-07-27
0.13.4 2012-07-27
0.13.3 2012-07-12
0.13.2 2012-06-29
0.13.1 2012-06-08
0.13.0 2012-05-30
0.12.1 2012-05-08
0.12.0 2012-05-03
0.11.2 2012-04-23
0.11.1 2012-03-31
0.10.8 2012-03-09
0.10.7 2012-03-08
0.10.6 2012-02-26
0.10.4 2012-02-20
0.10.3 2012-02-20
0.10.2 2012-02-15
0.10.1 2012-01-23
0.10.0 2012-01-22
0.9.3 2012-01-19
0.9.2 2012-01-19
0.9.1 2012-01-06
0.9.0 2011-12-28
0.8.9 2011-12-28
0.8.8 2011-12-28
0.8.7 2011-12-24
0.8.6 2011-12-19
0.8.5 2011-12-14
0.8.4 2011-12-11
0.8.3 2011-11-27
0.8.2 2011-11-19
0.8.1 2011-11-15
0.8.0 2011-11-13
0.7.6 2011-11-07
0.7.5 2011-11-05
0.7.4 2011-10-27
0.7.3 2011-10-23
0.7.2 2011-10-23
0.7.1 2011-10-23
0.7.0 2011-10-23
0.6.6 2011-10-19
0.6.5 2011-10-19
0.6.4 2011-10-14
0.6.3 2011-10-14
0.6.2 2011-10-09
0.6.1 2011-08-21
0.6.0 2011-08-17
0.5.1 2011-07-24
0.5.0 2011-06-22
0.4.1 2011-05-25
0.4.0 2011-05-15
0.3.4 2011-05-14
0.3.3 2011-05-12
0.3.2 2011-04-15
0.3.1 2011-04-01
0.3.0 2011-02-25
0.2.4 2011-02-19
0.2.3 2011-02-15
0.2.2 2011-02-14
0.2.1 2011-02-14
0.2.0 2011-02-14