maraujop/requests-oauth — Issue #5: Requests 0.8 breaks requests-oauth
Author: idangazit
Created: 2011-11-16 13:21:07+00:00
State: open

It appears that 0.8 breaks something in requests-oauth.

consider the following code:

```python
# I'm assuming you have CONSUMER_KEY, CONSUMER_SECRET,
# TWITTER_TOKEN, TWITTER_SECRET already.

import requests
from oauth_hook.hook import OAuthHook
OAuthHook.consumer_key = CONSUMER_KEY
OAuthHook.consumer_secret = CONSUMER_SECRET
hook = OAuthHook(TWITTER_TOKEN, TWITTER_SECRET)

client = requests.session(hooks={'pre_request': hook})

r1 = client.get('http://api.twitter.com/1/account/rate_limit_status.json')
print(r1)

r2 = client.get('http://api.twitter.com/1/account/verify_credentials.json')
print(r2)
```

With requests 0.7.6, both requests return 200. With 0.8.x, the 2nd (and subsequent request) return HTTP/500.

I checked with keep-alive disabled, but it doesn't solve the issue. :(