Can't tweet exclamation mark with v1.1


#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?


#2

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 ?


#3

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


#4

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?


#5

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…


#6

This might help : http://tools.ietf.org/html/rfc3986#section-2.2


#7

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?


#8

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


#9

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


#10

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


#11

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.


#12

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.