1
我試圖通過python訪問帳戶信息,這是OAuth 1.0。我有下面的代碼:AttributeError:使用Python時,'元組'對象沒有屬性'startswith'httplib
token_url = "oauth/token?" + urlencode(ksort(params)) + "&sig=%s",sig
conn = httplib.HTTPSConnection(url, 443)
conn.request("GET", token_url)
這報道:
Traceback (most recent call last):
File "C:\Users\windows\Desktop\https.py", line 35, in <module>
conn.request("GET", token_url)
File "C:\Python27\lib\httplib.py", line 973, in request
self._send_request(method, url, body, headers)
File "C:\Python27\lib\httplib.py", line 1001, in _send_request
self.putrequest(method, url, **skips)
File "C:\Python27\lib\httplib.py", line 900, in putrequest
if url.startswith('http'):
AttributeError: 'tuple' object has no attribute 'startswith'
連接正常,但我無法通過以下HTTPS請求去。