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.0.tar.gz (4.8 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.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: httpx_aiohttptransport-0.2.0.tar.gz
  • Upload date:
  • Size: 4.8 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.0.tar.gz
Algorithm Hash digest
SHA256 30db80c15777c5a456bb77d38a7e5c209c86039d09034543c0fd366d2436ccee
MD5 8112c6f5ff287319a3e957eae024954a
BLAKE2b-256 fab5d13397d68154769ea828d093f06c6fe5b9d5d0c8b0b85ef4d2e578d05f06

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for httpx_aiohttptransport-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ffcbde1871d337048081c762232a32538c5b2a0ad2aa2dc9672bf8169111d06c
MD5 4db64bd8ae291f052ca278ed6c379378
BLAKE2b-256 4bcf8c04bc2b00c366a4060427ff56a517b409ba1edd1f6364563e564a11fb6b

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