Awesome, thanks Taylor!

You're right, I was only sorting the oauth_* parameters. When I sort
all the params correctly (including 'follow') I can connect.

Thanks!
Mike

On Jan 24, 7:57 am, Taylor Singletary <taylorsinglet...@twitter.com>
wrote:
> Hi Michael,
>
> You're very close to getting this right -- from here it looks like it's just
> a matter of ordering parameters in the signature base string correctly.
>
> OAuth signature basestrings require that the various parameters involved in
> the request be lexigraphically sorted amidst the oauth_* parameters that are
> part of the request -- since "f" comes before "o", you'll want "follow=xyz"
> to appear before the oauth_* parameters.
>
> Like so:
>
> >  POST&https%3A%2F%2Fbetastream.twitter.com
> >> %2F2b%2Fsite.json&follow%3D110504712%26oauth_consumer_key%3DUHgNkU4fUYz44Kc
> >>  
> >> luSKQg%26oauth_nonce%3D1j3XUAgciQvppwqAez5wa6hkExv3669wCFg1OMuL%26oauth_sig
> >>  
> >> nature_method%3DHMAC-SHA1%26oauth_timestamp%3D1295800274%26oauth_token%3D15
> >>  264398-R38mT5QbA34LqsrYVEau6jwpJ1UUg5gy3lkEMDG4%26oauth_version%3D1.0
>
> Thanks,
> Taylor
>
>
>
>
>
>
>
> On Sun, Jan 23, 2011 at 8:39 AM, Michael Hoisie <hoi...@gmail.com> wrote:
> > Hi fellow Twitter devs,
>
> > I'm trying to connect to the Twitter site streams API with a Go client
> > (http://github.com/hoisie/twitterstream). There's no usable oauth
> > client for Twitter in Go, so I have to write it from scratch.
>
> > There seems to be something wrong with my HTTP request -- I was
> > wondering if anyone knew off-hand if I'm doing something wrong.
>
> > This is the request my client is sending:
>
> > POST /2b/site.json HTTP/1.1
> > Host: betastream.twitter.com
> > User-Agent: httplib.go
> > Content-Length: 16
> > Authorization: OAuth oauth_token="15264398-
> > R38mT5QbA34LqsrYVEau6jwpJ1UUg5gy3lkEMDG4",
> > oauth_timestamp="1295800274", oauth_version="1.0",
> > oauth_signature="ycWqdQ8pZSrzQgjrEPwi3rL%2BHd8%3D",
> > oauth_consumer_key="UHgNkU4fUYz44KcluSKQg",
> > oauth_nonce="1j3XUAgciQvppwqAez5wa6hkExv3669wCFg1OMuL",
> > oauth_signature_method="HMAC-SHA1"
>
> > follow=110504712
>
> > This is the base string for the signing:
> > POST&https%3A%2F%2Fbetastream.twitter.com%2F2b
> > %2Fsite.json&oauth_consumer_key%3DUHgNkU4fUYz44KcluSKQg%26oauth_nonce
> > %3D1j3XUAgciQvppwqAez5wa6hkExv3669wCFg1OMuL%26oauth_signature_method
> > %3DHMAC-SHA1%26oauth_timestamp%3D1295800274%26oauth_token%3D15264398-
> > R38mT5QbA34LqsrYVEau6jwpJ1UUg5gy3lkEMDG4%26oauth_version%3D1.0%26follow
> > %3D110504712
>
> > The user 110504712 has authorized the application via OAuth.
>
> > The consumer_token, consumer_token_secret, oauth_token, and
> > oauth_token_secret all come from my application on dev.twitter.com.
>
> > I'm confident the signing implementation is correct because I can get
> > Request and Access tokens. I believe there's something fundamentally
> > wrong with the base string or http request.
>
> > I'd really appreciate any help with this,
> > Mike
>
> > --
> > Twitter developer documentation and resources:http://dev.twitter.com/doc
> > API updates via Twitter:http://twitter.com/twitterapi
> > Issues/Enhancements Tracker:
> >http://code.google.com/p/twitter-api/issues/list
> > Change your membership to this group:
> >http://groups.google.com/group/twitter-development-talk

-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk

Reply via email to