Skip to content
Discussion options

You must be logged in to vote

@phy25 thanks, that has solved it. If I replace

async def request_get():
    return requests.get(URL)

with

async def request_get():
    async with httpx.AsyncClient() as client:
       return await client.get(URL)

then it executes in one second. PHEW!

I'll close the issue now. Thanks all and thanks FastAPI!

Replies: 6 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by YuriiMotov
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question or problem question-migrate
5 participants
Converted from issue

This discussion was converted from issue #1002 on February 28, 2023 10:53.