litl / rauth

A Python library for OAuth 1.0/a, 2.0, and Ofly.
http://readthedocs.org/docs/rauth/en/latest/
MIT License
1.6k stars 174 forks source link

Twitter POST requests failing #161

Open vgoklani opened 10 years ago

vgoklani commented 10 years ago

All of my Twitter POST requests are failing. I've followed the examples for authenticating:

self.oauth = OAuth1Service( name='twitter', consumer_key=consumer_key, consumer_secret=consumer_secret, request_token_url='https://api.twitter.com/oauth/request_token', access_token_url='https://api.twitter.com/oauth/access_token', authorize_url='https://api.twitter.com/oauth/authorize', base_url='https://api.twitter.com/1.1/' ) self.session = self.oauth.get_session( (access_token_key, access_token_secret) )

self.session.post('lists/members/create_all.json', params={'list_id':list_id, 'owner_screen_name':owner_screen_name, 'screen_name':chunked_screen_names_str})

AttributeError: 'NoneType' object has no attribute 'items'

The GET requests all work correctly.

I also tried to use an auth_session:

self.oauth.get_auth_session(access_token_key, access_token_secret, method='POST')

but received this error:

KeyError: 'Decoder failed to handle oauth_token with data as returned by provider. A different decoder may be needed. Provider returned: <?xml version="1.0" encoding="UTF-8"?>\n\n The access_token method must be called with a request_token\n /oauth/access_token\n\n'

vincenttheeten commented 10 years ago

Any progress on this one? Facing the same problem here.

maxcountryman commented 9 years ago

Can you post the full traceback? Also a code sample demonstrating the problem would be helpful.

davidkhess commented 9 years ago

I have to supply "data={}" to these calls or it fails like that for me too.