Question

I've successfully connected to twitter streaming API with the track parameter. I'm using OAuth Authentication and have written my own classes (so not using any libraries).

I've just added the location parameter. I have added this to the oauth_signature_base_string, in alphabetical order as stated in the docs. It's also encoded in this string as described in the docs.

I then add it along with the track parameter to the uri, but not encoded. Again I believe this is how the docs say to do it.

https://stream.twitter.com/1.1/statuses/filter.json?stall_warnings=true&track=silverstone&locations=-180,-90,180,90

The problem I'm encountering is that the addition of the location param to the authorization string causes the authentication to fail (i.e. 401 Unauthorized).

Anyone any idea on how the location parameter should be added to the header as this is where I think I'm going wrong (i.e. should the value of the location be encoded?)

Cheers. Tim

Was it helpful?

Solution

It turned out in the end that the header was incorrect due to the using System.Uri.EscapeUriStringand not System.Uri.EscapeDataString

Always use System.Uri.EscapeDataString to encode any string for the twitter OAuth api.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top