我正在尝试使用python sdk上载图片:
代码:
graph = facebook.GraphAPI(self.current_user.access_token)
graph.put_object("me", "photos", name = "test", message = raw_picture_data)
但是我得到了错误"GraphAPIError: (#324) Requires upload file"
。我不认为这是权限问题,因为我已经请求perms=“用户照片,朋友照片,发布流”。有人知道这个错误意味着什么,以及如何解决它吗?在
我用这个库来编码图像:http://atlee.ca/software/poster/
将此添加到脸谱网.py公司名称:
将照片作为类似文件的对象调用函数:
^{pr2}$put_photo方法已经由某人(我忘了是谁)提交的,建议添加到API中,但直到我使用poster对图像进行编码,它才对我起作用。在
希望这有帮助。在
也许你可以试试这个。 http://od-eon.com/blogs/tudor/facebook-photo-upload-google-app-engine/
我试着用这个来solved my problem,但是我得到了这个响应-
{“error”:{“type”:“OAuthException”,“message”:“在传递访问令牌时必须使用https://”}
只是和一个类似的错误作斗争。我没有使用SDK,只是在graphapi上发布了一个帖子。对我来说,这个错误发生在我没有给发送到facebook的“表单”文件上传字段提供文件名时。 这是我的代码(海报-http://pypi.python.org/pypi/poster/0.8.1)
相关问题 更多 >
编程相关推荐