Skip to content

Instantly share code, notes, and snippets.

@Lukasa Lukasa/timeout.py
Created Apr 1, 2014

Embed
What would you like to do?
Example of setting global timeout in requests.
from requests.adapters import HTTPAdapter
class TimeoutAdapter(HTTPAdapter):
def send(self, *args, **kwargs):
kwargs.setdefault('timeout', 30)
super(TimeoutAdapter, self).send(*args, **kwargs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.