cURL on GoDaddy issue…

Just Posted: Apple Likely to Give Education Rather than Resolution for iPhone 4 Antenna Issues

When coding up ezTweet I came across a problem with my implementation of cURL updating my status using the Twitter API. It worked fine on all of my other hosting environments and dev environment… I was stumped… After some Google searching I found out that using cURL to access secure destinations required a proxy implementation, however GoDaddy seem to suggest now that this is no longer needed.

So – was it my code? Odd that it would work elsewhere though… I tried all sorts of stuff, but eventually found the problem. Originally I had the following in my cURL statements:

$this->twitterHost .= "statuses/update.xml?status=".urlencode(stripslashes(urldecode($stat)));

Turns out, GoDaddy is not a fan of this implementation… Like I said, it works, Twitter do accept it – however GoDaddy for whatever reason stopped it. The Twitter API documentation states it does require a POST, so I re-jigged the code to the following:

$this->twitterHost .= "statuses/update.xml";
curl_setopt($this->ch, CURLOPT_POSTFIELDS, "status=".urlencode(stripslashes(urldecode($stat))));

Hey presto! All working! :) Would love someone a bit more technical to explain why the previous version worked elsewhere except GoDaddy… Please :D

One Response to “cURL on GoDaddy issue…”

  1. Sofia Singh says:

    I have 100 domains on Godaddy and i can say that this company is very reputable.,:”

Leave a Reply