Overview of aiohttp components and APIs
masteraiohttp is an asyncio-based HTTP client/server framework for Python. It is divided into three main functional areas:
1. Server (aiohttp.web)
Provides an HTTP/1.1 server including routing, middleware, WebSocket support, static-file serving, and a Gunicorn worker. Key APIs:
aiohttp.web.Applicationweb.RouteTableDefweb.run_appweb.AppRunnerweb.WebSocketResponseweb.FileResponse
2. Client (aiohttp.ClientSession)
Provides an HTTP/1.1 client including connection pooling, TLS, proxy support, redirects, cookie handling, and WebSockets. Key APIs:
aiohttp.ClientSessionaiohttp.TCPConnectoraiohttp.ClientResponseaiohttp.WSMessageaiohttp.BasicAuth
3. Shared Wire-Protocol Code
Core logic used by both client and server for protocol handling. Key APIs:
aiohttp.MultipartReader/MultipartWriteraiohttp.CookieJaraiohttp.TraceConfigaiohttp.resolver.AsyncResolver