那如何使用eventlet?如果您想在10秒后使请求超时,即使正在接收数据,此代码段也将为您工作:
import requestsimport eventleteventlet.monkey_patch()with eventlet.Timeout(10): requests.get("http://ipv4.download.thinkbroadband.com/1GB.zip", verify=False)
欢迎分享,转载请注明来源:内存溢出
那如何使用eventlet?如果您想在10秒后使请求超时,即使正在接收数据,此代码段也将为您工作:
import requestsimport eventleteventlet.monkey_patch()with eventlet.Timeout(10): requests.get("http://ipv4.download.thinkbroadband.com/1GB.zip", verify=False)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)