Can't tweet exclamation mark with v1.1


Status update with “Hi!” works with v1 but not with v1.1
I have a “Could not authenticate you” error (code=32) now

Looks like it’s related to OAuth encoding. Any idea?


It seems that ‘!’ needs to be encoded as ‘%21’ in the POST request body (application/x-www-form-urlencoded) with v1.1 while it was not needed for v1.
Is this the correct behavior ?


Yes, this is the correct behavior. Our OAuth and HTTP standards are a bit stricter in API v1.1


I just hit this and spent 1/2 hour debugging it.

Any other characters that need escaping in 1.1 that didn’t in 1.0?


Discovered through school of hard knocks that '!()*+ all need to be escaped with the 1.1 API and didn’t need to be with the 1.0 API. I hope there aren’t any others I’ve missed…


This might help :


I ran into this problem when tweeting with exclamation marks through the Perl Net::Twitter library (from CPAN). I’m using uri_escape() now and the tweets are showing up with the escape characters (%21) instead of the unescaped character (!). Any idea why this might be happening?


Having the same issue - did you ever figure it out? :frowning:


There was an update to Net::Twitter. After updating, all I had to do was change the API::REST flag to API::RESTv1_1.


Hmm, wish I was using Net::Twitter now! :wink: Time to find that update. Thanks for your quick response.


I use JS oauth and after painstakingly moving to 1.1 with stricter oauth, this seems to be another roadblock. My tweets with ', !, ) (in ajax post data) do not get posted. Can anyone help on what’s the good way to encode. Using JS encodeURIComponent does not solve it. May be because the oauth lib encodes in a different way.


Confirming what @tfrizz85 said: The problems I was having with Net::Twitter and getting auth errors were fixed when I updated to the latest versions of Net::Twitter.