0
나는 이벤트의 세부 사항과 그 이벤트에 관심이있는 사용자의 세부 정보를 표시하는 페이지를 만들고 있습니다. Facebook의 Python-SDK (https://github.com/facebook/python-sdk)를 사용하고 있으며 현재 로그인 한 사용자의 액세스 토큰을받는 데 아무런 문제가 없습니다. 그러나 사용자가이 이벤트 세부 정보 페이지를 방문하면이 이벤트에 관련된 사용자의 이름과 프로필 사진을 볼 수 있습니다. 사용Facebook 그래프 API : 400 사용자 데이터를 가져올 때 잘못된 요청
for liftoffer in self.liftoffers:
if (liftoffer.user.key() == dbuser.key()):
self.hasliftoffer = True
self.template_values['myliftoffer'] = liftoffer
logging.warn("Request: fbuser = graph.get_object(%s, fields=\"name, picture, username\")" % str(liftoffer.user.fbid))
logging.warn("access_token: %s" % self.current_user.access_token)
fbuser = graph.get_object(str(liftoffer.user.fbid), fields="name, picture, username")
newuser = ListUser(fbuser['name'], fbuser['picture'], fbuser['username'], liftoffer.user.key())
self.drivers.append(newuser)
그래프가 이미이 시점에서 정의되었습니다 :
ERROR 2011-04-27 17:45:42,007 __init__.py:427] HTTP Error 400: Bad Request
Traceback (most recent call last):
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/webapp/__init__.py", line 634, in __call__
handler.get(*groups)
File "/Users/wadben/Documents/Dev/Python/facebook-python-sdk-322930c/examples/oauth/sp-oauth-local/sparewheels.py", line 83, in get
self.get_secure()
File "/Users/wadben/Documents/Dev/Python/facebook-python-sdk-322930c/examples/oauth/sp-oauth-local/sparewheels.py", line 485, in get_secure
fbuser = graph.get_object(str(liftoffer.user.fbid), fields="name, picture, username")
File "/Users/wadben/Documents/Dev/Python/facebook-python-sdk-322930c/examples/oauth/sp-oauth-local/facebook.py", line 88, in get_object
return self.request(id, args)
File "/Users/wadben/Documents/Dev/Python/facebook-python-sdk-322930c/examples/oauth/sp-oauth-local/facebook.py", line 172, in request
urllib.urlencode(args), post_data)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 121, in urlopen
return _opener.open(url, data)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 380, in open
response = meth(req, response)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 491, in http_response
'http', request, response, code, msg, hdrs)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 418, in error
return self._call_chain(*args)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 353, in _call_chain
result = func(*args)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 499, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 400: Bad Request
: 여기
graph = facebook.GraphAPI(self.current_user.access_token)
내가 얻을 오류가 나는 사용자의 목록을 채우는 데이 코드를 사용 로그 라인은 요청이 유효한 Facebook ID와 access_token을 가져 왔음을 보여 주므로 여기에서 잘못된 점을 이해하지 못합니다. 현재 로그인 한 페이스 북과 다른 페이스 북 사용자의 사진과 사용자 이름을 얻을 수 없습니까?