Answer the question
In order to leave comments, you need to log in
How to solve the problem of requests using the requests library to unresponsive servers?
Greetings. The documentation for requests recommends using a timeout of slightly more than 3 seconds.
It’s a good practice to set connect timeouts to slightly larger than a multiple of 3, which is the default TCP packet retransmission window.
r = requests.get('https://github.com', timeout=3.05)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question