我得到:错误的请求

发布于 2024-12-07 03:14:39 字数 2013 浏览 0 评论 0原文

我正在开发两个类似的 FB 应用程序。一个有效,但副本给出“错误的请求”。

Environment:


Request Method: GET
Request URL: http://doctorme.herokuapp.com/?code=AQAAWe0A6wnm24YuT066ILJMInzeJ0YPANpzb_bnS5jJRCg62KAxmTmD1m56QFVxW5DRRWRgMN8lWFNTucZpQXPHPJstRiFVPE7IfIntei-qMkNlz30SICWvfPDlfvw1g0NPBrqvkPqjZtjAF4xtR8j-WpK89ZAiMARzr3i9_GwsK6Ruhk6Zg2hqYy-qgP4CWY0

Django Version: 1.3.1
Python Version: 2.7.1
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.admin',
 'django.contrib.admindocs']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware')


Traceback:
File "/app/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  111.                         response = callback(request, *callback_args, **callback_kwargs)
File "/app/doctorme/views.py" in home
  14.         access_token = fbapi_auth(request)[0]
File "/app/doctorme/fbapi.py" in fbapi_auth
  60.                               encode_func=simple_dict_serialisation)
File "/app/doctorme/fbapi.py" in fbapi_get_string
  48.     result = urllib2.urlopen(url).read()
File "/usr/local/lib/python2.7/urllib2.py" in urlopen
  126.     return _opener.open(url, data, timeout)
File "/usr/local/lib/python2.7/urllib2.py" in open
  398.             response = meth(req, response)
File "/usr/local/lib/python2.7/urllib2.py" in http_response
  511.                 'http', request, response, code, msg, hdrs)
File "/usr/local/lib/python2.7/urllib2.py" in error
  436.             return self._call_chain(*args)
File "/usr/local/lib/python2.7/urllib2.py" in _call_chain
  370.             result = func(*args)
File "/usr/local/lib/python2.7/urllib2.py" in http_error_default
  519.         raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)

Exception Type: HTTPError at /
Exception Value: HTTP Error 400: Bad Request

I have got two similar FB apps i am working on. The one works, the copy gives 'Bad request.'

Environment:


Request Method: GET
Request URL: http://doctorme.herokuapp.com/?code=AQAAWe0A6wnm24YuT066ILJMInzeJ0YPANpzb_bnS5jJRCg62KAxmTmD1m56QFVxW5DRRWRgMN8lWFNTucZpQXPHPJstRiFVPE7IfIntei-qMkNlz30SICWvfPDlfvw1g0NPBrqvkPqjZtjAF4xtR8j-WpK89ZAiMARzr3i9_GwsK6Ruhk6Zg2hqYy-qgP4CWY0

Django Version: 1.3.1
Python Version: 2.7.1
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.admin',
 'django.contrib.admindocs']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware')


Traceback:
File "/app/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  111.                         response = callback(request, *callback_args, **callback_kwargs)
File "/app/doctorme/views.py" in home
  14.         access_token = fbapi_auth(request)[0]
File "/app/doctorme/fbapi.py" in fbapi_auth
  60.                               encode_func=simple_dict_serialisation)
File "/app/doctorme/fbapi.py" in fbapi_get_string
  48.     result = urllib2.urlopen(url).read()
File "/usr/local/lib/python2.7/urllib2.py" in urlopen
  126.     return _opener.open(url, data, timeout)
File "/usr/local/lib/python2.7/urllib2.py" in open
  398.             response = meth(req, response)
File "/usr/local/lib/python2.7/urllib2.py" in http_response
  511.                 'http', request, response, code, msg, hdrs)
File "/usr/local/lib/python2.7/urllib2.py" in error
  436.             return self._call_chain(*args)
File "/usr/local/lib/python2.7/urllib2.py" in _call_chain
  370.             result = func(*args)
File "/usr/local/lib/python2.7/urllib2.py" in http_error_default
  519.         raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)

Exception Type: HTTPError at /
Exception Value: HTTP Error 400: Bad Request

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

此岸叶落 2024-12-14 03:14:39

检查您在 FB 应用程序和您的应用程序之间使用了正确的配置。

尝试一下 HTTPs(即使看起来不是 HTTPs 的情况...),使用 Heroku 只需 10 秒即可启用它:)

Check you're using the right configs among FB app and your app.

Give HTTPs a shot (even if it seems not the HTTPs case...) with Heroku it's just a matter of 10secs to have it enabled :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文