tornado.httpclient.HTTPError: HTTP 599: Timeout during request
tornado.httpclient.HTTPError: HTTP 599: Timeout during request
我正在尝试使用 Python Tornado AsyncHTTPClient
:
发出长时间的异步 http 请求
url = 'http://do_something_for_more_than_20_seconds.com/
client = httpclient.AsyncHTTPClient()
response = await client.fetch(url, method='GET')
但是,20 秒后,我收到此错误:
tornado.httpclient.HTTPError: HTTP 599: Timeout during request
如何配置 client
以允许长请求?
我尝试在 client
初始化后添加此配置行,但仍然不起作用:
client.configure(None, defaults=dict(connect_timeout=60, request_timeout=120))
如果你在客户端的构造函数中移动超时配置,它应该可以工作
client = httpclient.AsyncHTTPClient(defaults=dict(request_timeout=180))
我正在尝试使用 Python Tornado AsyncHTTPClient
:
url = 'http://do_something_for_more_than_20_seconds.com/
client = httpclient.AsyncHTTPClient()
response = await client.fetch(url, method='GET')
但是,20 秒后,我收到此错误:
tornado.httpclient.HTTPError: HTTP 599: Timeout during request
如何配置 client
以允许长请求?
我尝试在 client
初始化后添加此配置行,但仍然不起作用:
client.configure(None, defaults=dict(connect_timeout=60, request_timeout=120))
如果你在客户端的构造函数中移动超时配置,它应该可以工作
client = httpclient.AsyncHTTPClient(defaults=dict(request_timeout=180))