close

from tornado.httpclient import AsyncHTTPClient
from tornado.httpclient import HTTPRequest

 

def printResponse(data):
    print(data)

http_client = AsyncHTTPClient()
headers = {'Content-Type': "application/json"}
url = 'https://yourdomain.com'
req = HTTPRequest(url=url,
                      method='GET',
                      headers=headers)
resp = yield http_client.fetch(req, printResponse)

 

 

https://stackoverflow.com/questions/28405725/how-to-debug-tornado-async-operation

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 JohnDX 的頭像
    JohnDX

    我要回家想一想~

    JohnDX 發表在 痞客邦 留言(0) 人氣()