0
<?php
$service_url = 'http://coversat.localize.cc/api/statuses';
$curl = curl_init($service_url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$headers = ['X-Client-Id: XXXXXXX',
'X-Client-Secret: XXXXXX',
'Content-Type: application/json; charset=utf-8'
];
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
$curl_response = curl_exec($curl);
curl_close($curl);
if ($curl_response === false) {
$info = curl_getinfo($curl);
curl_close($curl);
die('error occured during curl exec. Additioanl info: ' . var_export($info));
} else {
$decoded = json_decode($curl_response);
}
?>
What exactly do you want?
– Isaias Lima
You are running
curl_close
twice. That doesn’t seem to make much sense.– Woss