【发布时间】:2018-11-30 22:25:22
【问题描述】:
我正在尝试使用 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))
【问题讨论】:
标签: python asynchronous tornado http-error