async-await support for `requests`.
Project description
requests-async
Brings support for async
/await
syntax to Python's fabulous requests
library.
Contributions towards closing off our outstanding issues would be very welcome! ✨ 🍰 ✨
Requirements
- Python 3.6, 3.7.
Installation
$ pip install requests-async
Usage:
Just use the standard requests API, but use await
for making requests.
Note: Use ipython
to try this from the console, since it supports await
.
import requests_async as requests
response = await requests.get('https://example.org')
print(response.status_code)
print(response.text)
Or use explicit sessions.
import requests_async as requests
with requests.Session() as session:
response = await requests.get('https://example.org')
print(response.status_code)
print(response.text)
The requests_async
package subclasses requests
, so you're getting all the
standard behavior and API you'd expect.
Limitations
- Streaming uploads and downloads are unsupported.
- SSL verification is not currently enabled.
- No timeout support yet.
See the issues list for more details.
Alternatives
The aiohttp
package provides an alternative client for making async HTTP requests.
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
File details
Details for the file requests-async-0.1.0.tar.gz
.
File metadata
- Download URL: requests-async-0.1.0.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 567e4b5f164527ab367ecfa9e78b5e0ecefb93c475f67246f251fd6a1808d09c |
|
MD5 | 80cacbd755bd901b56666354375da76f |
|
BLAKE2b-256 | 254ca22cbdf1c710637c62e90148e75f8a4e850189d8a646a5948e15eb8e06e8 |