HTTPClientDependency¶
- class safir.dependencies.http_client.HTTPClientDependency¶
Bases:
object
Provides an
httpx.AsyncClient
as a dependency.Notes
The application must call
http_client_dependency.aclose()
as part of a shutdown hook:@app.on_event("shutdown") async def shutdown_event() -> None: await http_client_dependency.aclose()
Methods Summary
__call__
()Return the cached
httpx.AsyncClient
.aclose
()Close the
httpx.AsyncClient
.Methods Documentation
- __call__() → httpx.AsyncClient¶
Return the cached
httpx.AsyncClient
.