diff --git a/src/fastapi_app/lib/clients/httpx.py b/src/fastapi_app/lib/clients/httpx.py new file mode 100644 index 0000000..4d0b672 --- /dev/null +++ b/src/fastapi_app/lib/clients/httpx.py @@ -0,0 +1,12 @@ +# Purpose: Provide an example of an async http client for the application +import contextlib +import typing + +import httpx + + +@contextlib.asynccontextmanager +async def get_http_client() -> typing.AsyncGenerator[httpx.AsyncClient, None]: + client = httpx.AsyncClient() # Insert your own settings here + async with client as ac: + yield ac