Skip to content

POST data not included in Client.request http request #144

Open
@spectranaut

Description

@spectranaut

The response from the following code https request claimed no POST data was included in the request. I believe this is unexpected and unwanted behavior?

import oauth2 as oauth

consumer_key = "<consumer key from twitter developer site>"
consumer_secret = "<consumer secret>"
oauth_token = "<access token>"
oauth_token_secret = "<access token secret>"
consumer = oauth.Consumer(key=consumer_key, secret=consumer_secret)
access_token = oauth.Token(key=oauth_token, secret=oauth_token_secret)
client = oauth.Client(consumer, access_token)

post_data = 'track=twitter'
stream_endpoint = "https://stream.twitter.com/1.1/statuses/filter.json"
response, data = client.request(stream_endpoint, "POST", body=post_data)

I tried to follow the problem to the source, and I believe it is because Request.to_postdata() does not return the body data. I can also provide the code that proves this.

I've noticed other recently complain on stackoverflow with the same problem! :( So I think something fishy is going on. I've not submitted a bug report before so let me know if if this could be better written.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions