来自 Mashape 团队的一个轻量级的 HTTP 库,实现了一个很简洁的异步接口。
def callback_function(response):
response.code # The HTTP status code
response.headers # The HTTP headers
response.body # The parsed response
response.raw_body # The unparsed response
thread = unirest.post("http://httpbin.org/post",
headers={ "Accept": "application/json" },
params={ "parameter": 23, "foo": "bar" },
callback=callback_function)