Bonjour J'utilise le python-sdk (http://github.com/facebook/python-sdk.git) sur google appengine. Je suis l'exemple "newsfeed".
En facebook.py je devais importer urllib2
puis changerfacebook python-sdk post_to_wall pièce jointe
file = urllib.urlopen("https://graph.facebook.com/" + path + "?" +
urllib.urlencode(args), post_data)
à
file = urllib2.urlopen("https://graph.facebook.com/" + path + "?" +
urllib.urlencode(args), post_data)
Maintenant, les travaux d'application de base. Toutefois, si je change
dans facebookclient.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
je vais obtenir l'erreur (sur http://localhost:8080):
Erreur HTTP 400: Bad Request
et le AppEngine le serveur de développement se plaint:
INFO 2010-10-24 17: 20: 44,483 dev_appserver.py:3275] "POST/post HTTP/1.1" 302 - AVERTISSEMENT 2010-10-24 17: 20: 44,570 urlfetch_stub.py:284] En-têtes interdits retirés de la requête URLFetch: ['Host']
INFO 2010-10-24 17: 20: 48167 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 -
AVERTISSEMENT 2010-10-24 17 : 21: 19,343 urlfetch_stub.py:284] En-têtes interdits retirés de la requête URLFetch: ['Content-Length', 'Host']
INFO 2010-10-24 17: 21: 20,634 dev_appserver.py:3275] "POST/post HTTP/1.1 "200 -