Repository navigation
Replies: 1 comment
|
For your current FastAPI runs ordinary Reuse the chosen client across requests and close it during application shutdown. Avoid wrapping every request in So there is no need to migrate working synchronous endpoints solely to use HTTPX. Choose the client that matches the calling code; migrate to async when concurrent outbound I/O makes that useful. References: HTTPX async support and FastAPI's handling of I checked both endpoint styles with shared clients and mock upstream responses on FastAPI 0.162.0 / HTTPX 0.28.1. This checks client integration, not a performance comparison. |
Uh oh!
There was an error while loading. Please reload this page.
I have a fastapi server and I want to use httpx client when it requests another web server.
I'm not using fastapi with
async defbut maybe I'll change that in the future.My question is: Is there a reason not to always use the async httpx client and use the asynchronous client?
All reactions