The following code executes no problem on 2 other servers I have access to and use to run on Hostgator. Hostgator tech support refuse to help as they feel it's an issue with the code. I get no response from the API unless I change the HTTPS to HTTP in which case I get a 307 redirect message from cloudfront.net. Any ideas on what a solution might be?
$data = array(
"status" => "Quote",
"job_address" => "1 Infinite Loop, Cupertino, California 95014, United States",
"job_description" => "Client has requested quote for service delivery"
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.servicem8.com/api_1.0/Job.json');
curl_setopt($ch, CURLOPT_USERPWD, "xxx@xxxxx.com:password");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_VERBOSE , true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Accept: application/json'));
$response = curl_exec($ch);
var_dump($response);