Python HTTP for Humans.
Project description
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. 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 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.
Installing Requests and Supported Versions
Requests is available on PyPI:
$ python -m pip install requests
Requests officially supports Python 3.8+.
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
API Reference and User Guide available on 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 (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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for odigos_requests-2.32.3.dev0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f70f6fd56049006b54b77202da8d92b578837f6ae66f870855dc7ea40002cf45 |
|
MD5 | a7e333d42763b1dd5a39be145c02e33c |
|
BLAKE2b-256 | 604e8401a0770dccf211749ce4ef7037815c6a6ad7afeb1ad64dae66b586ee9b |
Hashes for odigos_requests-2.32.3.dev0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eeef9c7841ac0df433058cfa4e1e6843f3ca88c2d3359f7fabc8ce9c0b43e180 |
|
MD5 | fbbc3ff5f6bf55be151d43f6d5f8721e |
|
BLAKE2b-256 | 3c0cfd5defe89a62707acf0ae135524da63d977da11ecc8e5eb7d887ae8f9dba |