[Done] How do I set the timeout for anvil.http on the client?

I need to control the timeout for anvil.http on the client, so it doesn’t wait forever, in case no response is received after a reasonable delay.

Thanks!

John

2 Likes

Hi @junderhill,

I agree this would be a useful addition - moving to Feature requests :slight_smile:

1 Like

Maybe make the HTTPX library available?

https://www.python-httpx.org/

I have run into the same problem - any updates on this?
Or is there a workaround possible?

  • other then making the request server side?

-Mark

We’ve now added the timeout argument to anvil.http.request

4 Likes

Awesome!
Thanks @stucork and the whole team!

One more question in this direction, is it possible to cancel a running http request?

Thanks, everyone! Very helpful.