1

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) )

and then tried this POST request:

self.session.post('/statuses/update.json', params={'status':"hi!"})

but got this error:

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: \n\n The access_token method must be called with a request_token\n /oauth/access_token\n\n'

I switched my code from rauth to birdy, and everything worked perfectly, but I would prefer to stay with rauth.

vgoklani
  • 10,685
  • 16
  • 63
  • 101
  • 1
    I'm attempting to test this, but have no idea what to use for `list_id`, `owner_screen_name` and `chunked_screen_names_str`. Could you give possible examples please? – Talvalin May 23 '14 at 16:42
  • Thanks for testing. I updated the example to just post the message "hi" from the corresponding twitter account. This returns the same error. – vgoklani May 23 '14 at 18:24
  • Is this the complete code? If so, how are you logging on to a specific account to post the status message? – Talvalin May 23 '14 at 19:06
  • This is just the relevant code snippet. I've already created a dev account with the necessary account credentials and extracted the relevant keys. – vgoklani May 23 '14 at 20:01

0 Answers0