我试图使用unirest库将API运行到dmoz。这是我的密码:
=========================================================================
import unirest
response = unirest.get("https://enclout-dmoz.p.mashape.com/show.json?auth_token=something&url=www.nike.com",
headers={
"X-Mashape-Key": "another_code"
}
)
html= response.body()
print html 但是我收到一条错误消息: Typeerror对象'dict‘是不可调用的。
发布于 2014-11-27 08:08:52
访问不带括号的数据集
html = response.body
print html发布于 2016-01-19 17:06:57
是的,回答是一本字典。它有以下成员
代码、头、正文和raw_body,您可以获得如下信息
# print response
print "code:"+ str(response.code)
print "******************"
print "headers:"+ str(response.headers)
print "******************"
print "body:"+ str(response.body)
print "******************"
print "raw_body:"+ str(response.raw_body)查看post http://stackandqueue.com/?p=57,详细说明如何使用unirest进行调用。
https://stackoverflow.com/questions/27165415
复制相似问题