Skip to content

Instantly share code, notes, and snippets.

@xiyoulaoyuanjia
Created October 9, 2015 14:26
Show Gist options
  • Save xiyoulaoyuanjia/6b672b6abc4dc3cc967f to your computer and use it in GitHub Desktop.
Save xiyoulaoyuanjia/6b672b6abc4dc3cc967f to your computer and use it in GitHub Desktop.
Timeout for python requests.get entire response
import requests
import eventlet
eventlet.monkey_patch()
with eventlet.Timeout(10):
requests.get("http://ipv4.download.thinkbroadband.com/1GB.zip", verify=False)
##### r = requests.get("get("http://ipv4.download.thinkbroadband.c", verify=False, timeout=10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment