Skip to main content

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 requests with async/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 await inside async functions.
  • Requires Python 3.7+ and aiohttp installed.

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

awaitedreqs-0.1.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

awaitedreqs-0.1.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file awaitedreqs-0.1.0.tar.gz.

File metadata

  • Download URL: awaitedreqs-0.1.0.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

Hashes for awaitedreqs-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7d10cf327e14b78251293269a31af7bb9962cd1e42c594dbbebb89369ecad590
MD5 9fc49c1fbd5c17acc2cccddd67e2315d
BLAKE2b-256 325da6daa7fe93c568433955c581a43e873001f27af1f7dbd9b5e6d8f8cffe74

See more details on using hashes here.

File details

Details for the file awaitedreqs-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: awaitedreqs-0.1.0-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

Hashes for awaitedreqs-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e3aee52cf137861b4bf1d27f61221787c3a549c5ac8593d26c53b78d7dea13cc
MD5 1758eab70ff4c4283dfd696dc5ff5fd1
BLAKE2b-256 2da2034e7609015f3db97df4ca153e43c634bfe225e6ec6241a308a6420647ad

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page