这是我的 Oauth 代码:
auth = OAuth1(client_key=consumer_key,
client_secret=consumer_secret,
resource_owner_key=access_key,
resource_owner_secret=access_secret,
signature_type='auth_header')
r = requests.get(url, auth=auth)
print r
错误:
r = requests.get(url,auth = auth)
File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 49, in get
return request('get', url, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 38, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 259, in request
prep = req.prepare()
File "/usr/local/lib/python2.7/dist-packages/requests/models.py", line 197, in prepare
p.prepare_auth(self.auth)
File "/usr/local/lib/python2.7/dist-packages/requests/models.py", line 329, in prepare_auth
r = auth(self)
File "/usr/local/lib/python2.7/dist-packages/requests_oauthlib/core.py", line 41, in __call__
decoded_body = extract_params(r.data)
AttributeError: 'PreparedRequest' object has no attribute 'data'