views:

82

answers:

2

Hi everyone,

I am having some slight problem with Twitter Oauth and fsock. The reason I am using fsock, is to cater people that do not have curl installed.

So here goes my problem. I was able to use fsock to get the access token however when I use fsock to update twitter status. It returns me with an Internal Error 500.

Here is what I post:

POST https://api.twitter.com/1/statuses/update.json HTTP/1.1
Host: api.twitter.com
Authorization: OAuth oauth_consumer_key=qArHWfcnikadIzP2k6EVg&oauth_nonce=bf07179df00bee93a9537ec12a1d7be6&oauth_signature=Ugs%2FGAPrtFIrRqhGQ9KrkrEYPVI%3D&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1283772251&oauth_token=177905108-JwUzEOE1ekGUbQieMBtB4P4L11WrEej6izvHQbJA&oauth_version=1.0&status=Published%20a%20new%20blog%20entry%20title%3AA%20Look%20Back%20%28and%20Forward%29%20at%20the%20Latest%20Tech%20Gadgets%20under%20category%3ATechnology
User-Agent: TwitterOAuth v0.2.0-beta2
Content-type: application/x-www-form-urlencoded
Connection: Close

And this is what twitter replied me with:

HTTP/1.1 500 Internal Server Error
Date: Mon, 06 Sep 2010 11:24:06 GMT
Server: hi
Status: 500 Internal Server Error
Content-Type: text/html; charset=utf-8
Content-Length: 4659
Cache-Control: no-cache, max-age=300
Set-Cookie: k=110.159.136.116.1283772246202732; path=/; expires=Mon, 13-Sep-10 11:24:06 GMT; domain=.twitter.com
Set-Cookie: guest_id=128377224620512308; path=/; expires=Wed, 06 Oct 2010 11:24:06 GMT
Set-Cookie: _twitter_sess=BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%250ASGFzaHsABjoKQHVzZWR7AA%253D%253D--1164b91ac812d853b877e93ddb612b7471bebc74; domain=.twitter.com; path=/
Expires: Mon, 06 Sep 2010 11:29:06 GMT
Vary: Accept-Encoding
Connection: close

Your help will be greatly appreciated.

A: 
POST https://api.twitter.com/1/statuses/update.json HTTP/1.1

You probably mean:

POST /1/statuses/update.json HTTP/1.1

While opening the socket with:

fsockopen("ssl://api.twitter.com", 443, $errno, $errstr, $timeout);
Artefacto
Tried POST /1/statuses/update.json HTTP/1.1 method but still error 500. I am already using. fsockopen("ssl://api.twitter.com", 443, $errno, $errstr, $timeout);
Lex
@Lex No idea then. The error message says nothing. You can try to see what a valid request looks like and compare.
Artefacto
A: 

Thanks for the suggestions arte, but looks like it didn't help much.

POST /1/statuses/update.json HTTP/1.1

Tried this but still gives me error 500.

fsockopen("ssl://api.twitter.com", 443, $errno, $errstr, $timeout);

I am already using this.

Lex