有人可以帮忙解决这个问题。提前谢谢。
我使用nonce,callback_url,consumer_key等向twitter发送请求。然后,Twitter会提示用户输入登录名和密码。用户成功输入登录凭据。之后,Twitter将oauth_token和oauth_verifier发送到前一次调用中指定的回调URl。但现在我总是得到'HTTP Error 401:Unauthorized'错误。有人可以帮忙吗?花了几天时间。谢谢。
“GET / account / twitter / oauthacc?oauth_token = ererererer& oauth_verifier = ereret43rwererererer”
HTTP Error 401: Unauthorized
Traceback (most recent call last):
File
"/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/_webapp25.py", line 714, in __call__handler.get(*groups)
File "/base/data/home/apps/s~test/2-7.3629731/oauth.py", line 74, in get
self.mOauthRequestToken = vOauthApi.getRequestToken(self.ACCESS_TOKEN_URL)
File "/base/data/home/apps/s~-test/2-7.369731/libs/oauthtwitter.py", line 206, in getRequestToken
resp = self._FetchUrl(url, no_cache=True)
File "/base/data/home/apps/s~test/2-7.3639731/libs/oauthtwitter.py", line 118, in _FetchUrl
url_data = opener.open(url).read()
File "/base/python_runtime/python_dist/lib/python2.5/urllib2.py", line 387, in open
response = meth(req, response)
File "/base/python_runtime/python_dist/lib/python2.5/urllib2.py", line 498, in http_response
'http', request, response, code, msg, hdrs)
File "/base/python_runtime/python_dist/lib/python2.5/urllib2.py", line 425, in error
return self._call_chain(*args)
File "/base/python_runtime/python_dist/lib/python2.5/urllib2.py", line 360, in _call_chain
result = func(*args)
File "/base/python_runtime/python_dist/lib/python2.5/urllib2.py", line 506, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 401: Unauthorized