Aiohttp
An asynchronous HTTP Client/Server for Python’s asyncio, built on the llhttp C parser with Cython-accelerated hot paths. Sharing client and server in a single, well-tested dependency — with WebSockets and middlewares on both sides — keeps things simple when you’re building services that both consume and serve HTTP.
aiohttp powers Home Assistant, Pulp, aiogram, the Molotov load tester, and many others.
As a client, aiohttp provides:
- Connection pooling and a shared cookie jar across requests.
- Streaming uploads and downloads.
- WebSocket support.
- Middlewares to customise request/response processing.
- Tracing hooks for observability.
As a web server/framework, aiohttp provides:
- WebSocket support.
- Middlewares to customise request/response processing.
- Optional handler cancellation when a client disconnects.
- First-party testing utilities, including a pytest-aiohttp plugin.
- An extensive collection of first and third party libraries extending the core functionality.