嗨
我正在使用pythonsdk(http://github.com/facebook/python-sdk.git)在谷歌appengine上。
我正在运行“newsfeed”示例。
在脸谱网.py我不得不导入urllib2
然后改变
file = urllib.urlopen("https://graph.facebook.com/" + path + "?" +
urllib.urlencode(args), post_data)
到
^{pr2}$现在基本的应用程序开始工作了。但是如果我改变了
在facebook客户端.py
try:
self.graph.put_wall_post(message)
except Exception, e:
self.response.out.write(e)
return
到
try:
attachment = {}
message = message
caption = 'test caption'
attachment['caption'] = caption
attachment['name'] = 'test name'
attachment['description'] = 'test description'
self.graph.put_wall_post(message, attachment=attachment)
except Exception, e:
self.response.out.write(e)
return
我将得到错误(在http://localhost:8080):
HTTP错误400:错误请求
appengine开发服务器抱怨:
信息2010-10-24 17:20:44483开发_appserver.py:3275]“POST/POST HTTP/1.1”302-
警告2010-10-24 17:20:44570 urlphetch_存根。py:284]从urlphetch请求中删除了禁止的头:['Host']
信息2010-10-24 17:20:48167开发_appserver.py:3275]“获取/HTTP/1.1”200-
信息2010-10-24 17:20:48292开发_appserver.py:3275]“获取/静态/基本.cssHTTP/1.1“200-
警告2010-10-24 17:21:19343 urlphetch_存根。py:284]从urlphetch请求中删除了禁止的头:['Content-Length','Host']
信息2010-10-24 17:21:20634开发_appserver.py:3275]第200.1版后HTTP-
通过使用“放置”对象而不是“粘贴到墙”来解决此问题:
有关如何使用curl进行post的示例,请参见http://developers.facebook.com/docs/reference/api/post
相关问题 更多 >
编程相关推荐