title: oAuth verification for using Twitter API with Python
body: <p>I'm trying to get the oauth request_token for Twitter as described here, making a call to "oauth/request_token": <a href="https://dev.twitter.com/docs/auth/implementing-sign-twitter" rel="nofollow">https://dev.twitter.com/docs/auth/implementing-sign-twitter</a></p>
  
  <p>I'm generating the params using the encode_params function in here: <a href="https://github.com/sixohsix/twitter/blob/master/twitter/oauth.py" rel="nofollow">https://github.com/sixohsix/twitter/blob/master/twitter/oauth.py</a></p>
  
  <p>I then wrap the returned string in a dict with they key "Authorization" and dump it into the Headers of the Post request I'm making using the python request library. Here's the two lines I use to create the request.</p>
  
  <pre><code>ep = "OAuth " + auth.encode_params(baseUrl, method, params)
  response = requests.post(baseUrl+method, headers={ "Authorization" : ep})
  </code></pre>
  
  <p>The eventual header looks like this (consumer_key modified):</p>
  
  <pre><code>{'Accept': '*/*',
   'Accept-Encoding': 'gzip, deflate, compress',
   'Authorization': 'OAuth oauth_callback=http%253A%252F%252Fec2-54-244-189-248.us-west-2.compute.amazonaws.com%252Fct%252Ftwitter_login_handler%252F&amp;oauth_consumer_key=xxx&amp;oauth_nonce=14937468581358710045&amp;oauth_signature_method=HMAC-SHA1&amp;oauth_timestamp=1366568033&amp;oauth_version=1.0&amp;oauth_signature=kiYucZzPY%2FXy2WyJliJ6YcggVzQ%3D',
   'Content-Length': '0',
   'User-Agent': 'python-requests/1.2.0 CPython/2.7.3 Linux/3.5.0-21-generic'}
  </code></pre>
  
  <p>However, I'm still getting a 401 response that says: 'Failed to validate oauth signature and token'</p>
  
  <p>Any idea what I'm doing wrong? Any help would really be appreciated. </p>