Hi
I am using the python-sdk (http://github.com/facebook/python-sdk.git) on google appengine.
I am runnig the "newsfeed" example.
In facebook.py i had to import urllib2
and then change
file = urllib.urlopen("https://graph.facebook.com/" + path + "?" +
urllib.urlencode(args), post_data)
to
file = urllib2.urlopen("https://graph.facebook.com/" + path + "?" +
urllib.urlencode(args), post_data)
Now the basic application works. However if I change
in facebookclient.py
try:
self.graph.put_wall_post(message)
except Exception, e:
self.response.out.write(e)
return
to
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
i will get the error (on http://localhost:8080) :
HTTP Error 400: Bad Request
and the appengine development server complains:
INFO 2010-10-24 17:20:44,483 dev_appserver.py:3275] "POST /post HTTP/1.1" 302 -
WARNING 2010-10-24 17:20:44,570 urlfetch_stub.py:284] Stripped prohibited headers from URLFetch request: ['Host']
INFO 2010-10-24 17:20:48,167 dev_appserver.py:3275] "GET / HTTP/1.1" 200 -
INFO 2010-10-24 17:20:48,292 dev_appserver.py:3275] "GET /static/base.css HTTP/1.1" 200 -
WARNING 2010-10-24 17:21:19,343 urlfetch_stub.py:284] Stripped prohibited headers from URLFetch request: ['Content-Length', 'Host']
INFO 2010-10-24 17:21:20,634 dev_appserver.py:3275] "POST /post HTTP/1.1" 200 -