Async requests-like HTTP client built on aiohttp with requests-compatible API
Project description
aiohttprequests
An async requests-like HTTP client built on aiohttp with requests-compatible API.
Installation
pip install aiohttprequests
text
Usage
import aiohttprequests as requests import asyncio
async def main():
Simple GET
response = await requests.get('https://httpbin.org/get') print(response.content) print(response.text) data = await response.json() print(data)
text
Using Session for persistent connection and cookies
async with requests.Session() as session: await session.get('https://httpbin.org/cookies/set/sessioncookie/123456789') r = await session.get('https://httpbin.org/cookies') print(await r.text) asyncio.run(main())
text
Features
- Fully async API, drop-in replacement for
requestswithasync/await. - Supports all standard HTTP methods:
get,post,put,delete, etc. - Session support with cookie persistence.
- Response object mimics
requests.Response. - Supports streaming, file uploads, JSON, timeout, headers, auth, and more.
Notes
- Must call all methods with
awaitinside async functions. - Requires Python 3.7+ and aiohttp installed.
License
MIT License
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file awaitedreqs-0.1.1.tar.gz.
File metadata
- Download URL: awaitedreqs-0.1.1.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9732b4a18deefca1389fd0d044ea80dbb31005348565ff3899a1b6c968339afa
|
|
| MD5 |
88edb17a77aa13e87556569746da631f
|
|
| BLAKE2b-256 |
fceb0f6debd92d83d8b7856abb213e28230fcd87dac24c9dd33615b6c352ff25
|
File details
Details for the file awaitedreqs-0.1.1-py3-none-any.whl.
File metadata
- Download URL: awaitedreqs-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
709ac810060cb90d4b36223d44ac9885acba9fb8de5afc57ace95c7191112d29
|
|
| MD5 |
fd5092f8756caa11c15e686ce40564f7
|
|
| BLAKE2b-256 |
bc50dbe67db7022728cb5005f3a4f855ece0089d2ab79ff918cc341a7e4f4b25
|