【发布时间】:2017-09-16 07:16:50
【问题描述】:
下面是来自龙卷风documentation的sn-p。
def handle_response(response):
if response.error:
print("Error: %s" % response.error)
else:
print(response.body)
http_client = AsyncHTTPClient()
http_client.fetch("http://www.google.com/", handle_response)
但这不会向控制台打印任何内容。我尝试在最后添加time.sleep,但即使这样也没有任何打印。
此外,当我将上面的 url 更改为指向我的服务器时,它不会向我的服务器发送任何请求。
tornado.httpclient.HTTPClient 工作正常。
我在 Macbook 上使用 Python 3.6.1。
【问题讨论】: