龙卷风提取

时间:2019-05-30 06:39:37

标签: python asynchronous tornado

我正在尝试使用龙卷风的asynchttpclient获取简单的方法。在使用回调的URL上使用fetch()。

 def handle_request(response):
   if response.error:
     print("Error:", response.error)
   else:
     print(response.json())

 http_client = tornado.httpclient.AsyncHTTPClient()
 http_client.fetch(url, method='GET', callback=handle_request)

但是我从没看到回调执行。我也没有看到任何错误。我在SO上看到了一些旧的答案,人们似乎正在讨论几乎相同的代码,该代码应该可以工作。

0 个答案:

没有答案