Timeout
noun
say it: “TYME-owt” /ˈtaɪmˌaʊt/
The longest a program waits for a server to answer before it gives up, and the error it gets when that time runs out.
What is a timeout on a request?
A timeout is how long a program waits for a server's answer before giving up, and the error raised when that time runs out. Without one, a request to a server that never answers can wait forever.
try:
response = requests.get(url, headers=headers, timeout=10)
except requests.Timeout:
print("The weather service didn't answer in 10 seconds.")
In a sentence
- “The timeout error told her the server was too slow, not offline.”
- “With a ten-second timeout, the script gives up instead of hanging all night.”
Level: Journeyman · More REST API terms at this level
Updated