【发布时间】:2015-03-04 06:27:52
【问题描述】:
有人有工作代码或示例来更新 Twitter 个人资料图片吗?
python-oauth2 好不好。?我应该为此使用其他库吗?
使用:python 2.7,Django 1.7 python-oauth2
image_post = "https://api.twitter.com/1.1/statuses/update.json?status=ThisOneWorksPerfectly"
resp, content = client.request(image_post, "POST")
上面的代码工作得很好,但我把代码改成了updateprofileimage(见下文...)
image_post = "https://api.twitter.com/1.1/account/update_profile_image.json?image={}".format(encodedImage)
resp, content = client.request(image_post, "POST")
错误:
'{"errors":[{"message":"Could not authenticate you","code":32}]}'
【问题讨论】:
标签: python django twitter oauth-2.0