"403 Forbidden: The server understood the request, but is refusing to fulfill it." when sending tweets

qubeeydev
@qubeeydev Ben Klein

I'm trying to send tweets in Flash using the REST API and OAuth. I have the OAuth set up, I'm retrieving user feeds fine, but when I submit a tweet, I get a strange 403 response. What's even stranger, though, is that the feed still updates with the tweet I submitted.

Here's what the request form data looks like:
POST /1/statuses/update.json HTTP/1.1
Host: api.twitter.com
trim_user true
include_entities true
oauth_token XXXXXXXXXXXXXX
oauth_timestamp 1331749180
oauth_nonce 76776
oauth_version 1.0
oauth_signature_method HMAC-SHA1
status wwjd
oauth_signature LmkgPOZINWiXQeeR7lFmln8Edv4=
oauth_consumer_key XXXXXXXXXXXXXXX

Here's the response:
HTTP/1.1 403 Forbidden
Date: Wed, 14 Mar 2012 20:05:29 GMT
Status: 403 Forbidden
Content-Type: text/html; charset=utf-8
Cache-Control: no-cache, max-age=300
Set-Cookie: dnt=; domain=.twitter.com; path=/; expires=Thu, 01-Jan-1970 00:00:00 GMT
Expires: Wed, 14 Mar 2012 20:10:29 GMT
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 92
Server: tfe

403 Forbidden: The server understood the request, but is refusing to fulfill it.

Thanks!

20 weeks 6 days ago

Replies

qubeeydev
@qubeeydev Ben Klein

Nevermind, figured it out.
Apparently, despite the docs using "http://api.twitter.com/1/statuses/update.json", I was only able to get a proper response by changing the http to https.

20 weeks 6 days ago
episod
@episod Taylor Singletary

Make sure you aren't consuming or attaching cookies to your responses; the cookies may declare the request having to be over HTTPS. By sending cookies, you're mixing forms of authentication.

20 weeks 6 days ago
omastudios
@omastudios Jack Newcombe

Just ran into the same problem developing in Titanium Desktop and came across this topic trying to solve it. Changing it to https worked perfectly! Not sure why this is the case, maybe Twitter only allow cross-domain requests for https now? Either way thanks for sharing.

18 weeks 1 day ago
jagawatjaydev
@jagawatjaydev jaydev

hi please suggest me , how to use this json
http://twitter.com/statuses/update.json

1 week 4 days ago
episod
@episod Taylor Singletary

POST statuses/update describes how the tweeting method works. Tweets describes how Tweets are structured.

1 week 4 days ago
thelegend100
@thelegend100 Milton Rafael Feliz

hello

5 days 11 hours ago