HTTP Client — Aquilia Documentation
Comprehensive guide and documentation for HTTP Client in the Aquilia framework. View API reference, examples, and implementation patterns.
HTTP Client HTTP Client A fully asynchronous, production-grade HTTP client built natively into Aquilia. Zero external dependencies, deep framework integration, and designed for high-performance async workloads. Design Philosophy Aquilia's HTTP client is not a wrapper around existing libraries—it is a native implementation using Python's asyncio primitives, providing: , , , , ].map((item, i) => ( ))} Quick Example from aquilia import Controller, GET from aquilia.http import AsyncHTTPClient, HTTPClientConfig from aquilia.http.config import TimeoutConfig class WeatherController(Controller): prefix = "/weather" def __init__(self): self.http = AsyncHTTPClient(HTTPClientConfig( timeout=TimeoutConfig(total=5.0), user_agent="Aquilia/1.0", )) @GET("/ ") async def get_weather(self, ctx, city: str): # Make HTTP request response = await self.http.get( f"https://api.weather.com/v1/current/ ", headers= , ) # Parse JSON response data = await response.json() return ctx.json(data) async def __aenter__(self): return self async def __aexit__(self, *exc): await self.http.close() Core Features , , , , , , , , , , ].map((item, i) => ( ))} Architecture The HTTP client layers separate high-level APIs from low-level TCP/TLS transport protocols: AsyncHTTPClient Entry point API providing HTTP verb methods (get(), post(), etc.) wrapping the active session. HTTPSession Manages stateful cookies, headers, redirect limits, and executes the active middleware and interceptor chains. RequestBuilder Fluid API to validate headers, encode parameters, and serialize body contents. NativeTransport Handles async SSL/TCP socket connections, serializes HTTP headers, and parses responses in chunks. Dive Deeper , , , , , , ].map((item) => ( ))} Templates HTTPClient Basics )
Go to Homepage