当我使用请求从Python2.7调用SocialCastAPI时,我得到一个响应“reason”,但在实际的api中看不到该文本。我的代码是:
import requests
parameters = {"username" = "myUsername", "password" = "myPassword"}
response = requests.get("https://hub.sas.com/api/groups/808/messages.json", parameters)
response.json()
我要传递的JSON的开头是:
^{pr2}$所以我希望有别的东西回来,但它的回报是:
{u'reason': u''}
这是一个错误还是有什么我不明白?在
我用这个代码解决了我的问题:
我不确定}是否必要,但它最终对我有用,所以我把它们放在那里。在
from requests.auth import HTTPBasicAuth
或{相关问题 更多 >
编程相关推荐