Silly problem: 401 - Code 32 with some characters in POST /statuses/update#26
Silly problem: 401 - Code 32 with some characters in POST /statuses/update#26martin-naumann wants to merge 2 commits into
Conversation
…fail with 401, Code 32
…ing instead of body. WTF?
|
In your patch you simply use get instead of post. This will work for posting a new tweet, but not for the Stream API It will work if you got only a few keywords to track. Did you test your patch with really long queries on the public stream end-point? |
|
Shit! You're right. |
|
It's a problem with the Oauth-module: so when you update the Oauth-module in your installation the issue should be fixed. |
|
NPM is not up to date yet. So you have to apply the patch manually to your installation of oauth. (Normally in twit/node_modules/oauth/lib/oauth.js) Please test and tell us if it worked. :-) |
|
@kai-koch is right. I fixed this in twit by checking in the oauth module and published a new version of twit (v1.0.11). This version works with characters requiring escaping. Thanks for letting me know about that serious issue! |
|
Ah, I get it. Thanks for pointing it out to me! I already wondered where this weird problem comes from and why nobody pointed it out before. |
I encountered a weird bug.
When you have some special characters (e.g. "!") in your params to post a new tweet, it fails with Status 401, Code 32.
This error only appears in API v. 1.1 - 1.0 is fine.
The discussion at https://dev.twitter.com/discussions/11280 gave me the hint to try sending the POST data in the querystring instead of the body (wtf?) and 🎯 it worked!
As it doesn't seem to harm and solves this little pitfall, I patched the oarequest to supply POST params in the querystring, like GET did.
I don't know if this is a good idea or not - if you can think of a better way, I'd be glad to go it!