401 Unauthorized error, stream API, and URL parameter encoding


#1

I receive 401 Unauthorized errors even though the URL produced seems valid:
https://stream.twitter.com/1/statuses/filter.json?track=%23地震&delimited=length
I can get this URL to work through a browser and authenticating with username and password and through my IDE which makes me think it is more of an encoding error, but why then the 401?

I am using python and the libraries Twitty Twister and oauth2 and can provide a tcp dump.


#2

Are you using OAuth when you get the 401 Unauthorized error? In your signature base string, are all of those already percent-encoded entities percent-encoded again?

Example signature base string:

GET&https%3A%2F%2Fstream.twitter.com%2F1%2Fstatuses%2Ffilter.json&delimited%3Dlength%26oauth_consumer_key%3Dri8JxYK2ddwSV5xIUfNNvQ%26oauth_nonce%3D87b970ac806c7d81f902a9143595fd3f%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1324395532%26oauth_token%3D819797-RUzMC8TSS2jcNtjJwv2Yv7tsut85BVtFwSk8MuDg%26oauth_version%3D1.0%26track%3D%2523%25E5%259C%25B0%25E9%259C%2587


#3

hi @episod. Do I have to use OAuth for Streaming?


#4

what I supposed to do now?? Come on.


#5

You will be required to use OAuth 1.0A access tokens to use the Streaming API beginning May 7, 2013. I would recommend switching to using OAuth now.