Problems passing access token to authenticate with API

家住魔仙堡 提交于 2020-01-16 13:58:31

问题


I'm trying to get information from the Gimmebar API (redirects to the access token step) and having problems with the last step exchanging the access token for the data.

#getting access token successfully before this
post_url = '/tags'
headers = {'Authorization': 'Bearer %s' % access_token}
query = '/collections'
full_url = '%s%s%s' % (base_url, post_url, query)
req = urllib2.Request(full_url, headers=headers)
response = urllib2.urlopen(req)
the_page = response.read()

It breaks at the urllib2.Request and I'm getting an error that I'm not sure what to do with:

No exception supplied

Exception Location: /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py in http_error_default, line 510

Here is the view so you can see how I got to step5...

来源:https://stackoverflow.com/questions/8458011/problems-passing-access-token-to-authenticate-with-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!