Python请求模块连接超时

Python requests module connection timeout

我在查看http://docs.python-requests.org/en/latest/并将"连接超时"列为一个特性。但是,当我进一步阅读时,它指出

timeout is not a time limit on the entire response download; rather, an exception is raised if the server has not issued a response for timeout seconds (more precisely, if no bytes have been received on the underlying socket for timeout seconds).

这听起来不像是对连接超时的描述。我看到的是连接成功,它上载一个大文件,然后等待响应。但是,响应需要一段时间,然后超时。

如何设置连接超时,但在连接成功后仍等待慢速响应?谢谢。


the is used for both the套接字超时连接响应阅读实习和实习。唯一的例外是如果你streamed要求;集stream=Truecannot be the超时,portion to the阅读应用。is used for the真的只是等待超时连接套接字to或for the received to be的日期。P></

如果你需要使用一个超时安综合技术类,然后,利用interrupts或eventlets:Python for requests.get全部响应超时P></