我正在尝试通过 Python 从 Foursquare API 获取访问令牌。
我正在使用来自https://github.com/mLewisLogic/foursquare的包装器, 并且遵循http://log.hckr.org/2012/02/01/foursquare-api-wrapper-for-中提到的相同方法Python
但是,对于access_token = client.oauth.get_token('XX_CODE_RETURNED_IN_REDIRECT_XX')
. 我收到以下错误
Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
File "C:\Python27\lib\site-packages\foursquare\__init__.py", line 135, in get_token
response = _request_with_retry(url)
File "C:\Python27\lib\site-packages\foursquare\__init__.py", line 707, in _request_with_retry
return _process_request_with_httplib2(url, data)
File "C:\Python27\lib\site-packages\foursquare\__init__.py", line 733, in _process_request_with_httplib2
raise FoursquareException(u'Error connecting with foursquare API')
FoursquareException: Error connecting with foursquare API
我不确定错误是由于 httplib2 库还是其他原因!
任何人有任何解决方案?