Can you share an example of your POST body and the accompanying OAuth
signature base string?

Here's a quick example of a successful POST with commas and spaces, tweeting
the phrase "I like commas, but don't understand their syntax."

My POST body:
status=I%20like%20commas%2c%20but%20don%27t%20understand%20their%20syntax.

My Signature Base string:
POST&http%3A%2F%2Fapi.twitter.com
%2F1%2Fstatuses%2Fupdate.xml&oauth_consumer_key%3Dri8JxYK2ddwSV5xIUfNNvQ%26oauth_nonce%3DO6OYWbaeCxndCffIa5HYwSmxXufoICIoGvuqwpACc%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1304618104%26oauth_token%3D119476949-gF0B5O1Wwa2UqqIwopAhQtQVTzmfSIOSiHQS7Vf8%26oauth_version%3D1.0%26status%3DI%2520like%2520commas%252C%2520but%2520don%2527t%2520understand%2520their%2520syntax.

You only want to encode the comma once within your POST body, but twice
within your oauth signature base string (because you're escaping the already
escaped value).

Resultant status:
https://twitter.com/#!/oauth_dancer/status/66199246407344128

@episod <http://twitter.com/episod> - Taylor Singletary


On Thu, May 5, 2011 at 10:17 AM, TheMouth <thinking...@gmail.com> wrote:

> Hi Guys,
>
> I'm working on a web application that includes posting to twitter as part
> of it's functionality.  This works flawlessly until someone enters a comma
> in the status.
>
>    - I've done the googling on this and double checked that the status
>    text is being double-encoded, confirming that the commas are being sent as
>    %252C .
>    - The response error that I'm getting back from twitter is "invalid
>    authorization headers". However the same tweet without the commas doesn't
>    generate this error
>    - I can debug the application and check the params against
>    http://oauth.googlecode.com/svn/code/javascript/example/signature.htmland 
> the signature that we're sending matches the one generated there.
>
>
> Any ideas on why a comma would cause this even though it's double-encoded
> and the signature is valid?  I'm willing to pastebin some code of it would
> help.
>
> Thanks
>
> --
> 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