为了更好地理解超时,我一直在阅读http://www.mobify.com/blog/http-requests-are-hard/和http://docs.python-requests.org/en/latest/api/#requests.request。基于此,我可以看到连接超时:
connect_timeout = 0.0001
try:
response = requests.get(url="https://httpbin.org/delay/5",
timeout=(connect_timeout, 10.0))
except requests.exceptions.ConnectTimeout as e:
print "Too slow Mojo!"
读超时:
^{pr2}$我还对请求模块“放弃”感兴趣,如果响应没有在特定时间内完成。我不知道这种超时是什么意思。我该怎么做?在
目前没有回答
相关问题 更多 >
编程相关推荐