Skip to main content

Use `aiohttp` with `httpx` Interface

Project description

codecov PyPI version PyPI - Python Version PyPI - Downloads PyPI - License Code style: black

Use aiohttp with httpx Interface

httpx has performance issue, especially when working with high concurrency, while aiohttp does not.

However, your production code and tests may already heavily rely on httpx, making it difficult to migrate to aiohttp.

This repo provides a workaround: take advantage of httpx's custom transport capability to use aiohttp for the actual requests

pip install httpx-aiohttptransport

This package supports:

  • transport limits (max connection)
  • auth
  • proxy
  • respx. Run mock_router.set(router.handler) when you set up the respx mock router (see example).

Known limitations:

  • http2. aiohttp does not support http2.

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

httpx_aiohttptransport-0.2.1.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

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

httpx_aiohttptransport-0.2.1-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file httpx_aiohttptransport-0.2.1.tar.gz.

File metadata

  • Download URL: httpx_aiohttptransport-0.2.1.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.12.6 Darwin/24.1.0

File hashes

Hashes for httpx_aiohttptransport-0.2.1.tar.gz
Algorithm Hash digest
SHA256 62a874b53d53806a0f260549dc20e91b1acd4b586cb8c87723fe762f851979bb
MD5 066db1681fc32879252abf7e6d548b61
BLAKE2b-256 7d753093708d45dafaa609b64596866e7e92720a717604e28aa6494dd87545a2

See more details on using hashes here.

File details

Details for the file httpx_aiohttptransport-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for httpx_aiohttptransport-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 20f2a55eb3d2b9792e162d65b43af431247293033906b84cc1e2dbc3f40935f0
MD5 d30ee8aa0c8666959132535bbaddf5a3
BLAKE2b-256 9a3416a6c464ebda1b498087c581a51ae6f644cfa26d3d3e248f73cb9cfe1686

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