views:

28

answers:

1

Hi ,

in my server i have enabled the CURL , Even am using some contact grabber and paypal , and so many application with curl ,

But i dont know why this Twitter showing response as 417

this is my snippet ,

$host = "http://twitter.com/statuses/update.xml?status=".urlencode(stripslashes(urldecode($message))); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $host); curl_setopt($ch, CURLOPT_VERBOSE, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_USERPWD, "$username:$password"); curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); curl_setopt($ch, CURLOPT_POST, 1); $result = curl_exec($ch); // Look at the returned header $resultArray = curl_getinfo($ch); curl_close($ch); if($resultArray['http_code'] == "200"){ $twitter_status='Your message has been sended! See your profile'; } else { $twitter_status="Error posting to Twitter. Retry"; } return $twitter_status;

But this snippet working find in local system ,

can please tell me , in snippet is there anything wrong ,

+1  A: 

Try also including this line in your code:

curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));
Dan U.