有限连接超时和无限读取超时

时间:2021-05-16 08:37:05

标签: python python-requests

从文档 here 中,如果您想分别设置 connectread 超时,我们可以指定一个元组:

r = requests.get('https://github.com', timeout=(3.05, 27))

现在我希望 connect 超时为 10 秒,read 超时无限制。我下面的设置正确吗?

r = requests.get('https://github.com', timeout=(10, None))

0 个答案:

没有答案