Open
Description
Hello,
I'm aware of the ability to set a custom http_client
parameter but that is now requiring a bit more.
Looking at the code now:
self._http_client = http_client or httpx.AsyncClient(
transport=httpx.ASGITransport(app=self.fastapi, raise_app_exceptions=False),
base_url=self._base_url,
timeout=10.0,
)
The latest version requires copying the base url and ASGITransport call. In my use case, I'd like to just override the timeout.
Could we add a new parameter such as client_args
with a dictionary of options to overlay when creating the client. For example:
self._http_client = http_client or httpx.AsyncClient(
**{{
transport=httpx.ASGITransport(app=self.fastapi, raise_app_exceptions=False),
base_url=self._base_url,
timeout=10.0,
}, **client_args}
)
This would have the benefit of allowing a user to override a single http client parameter without having to know what else to pass.