I am trying to upload a file to this API : http://www.noelshack.com/api.php I don't know anything about cURL. I have find sample codes, and i have try this :
<?php
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'http://www.noelshack.com/api.php');
// send a file
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt(
$curl,
CURLOPT_POSTFIELDS,
array(
'fichier' => '@http://cdn.soccerwiki.org/images/player/2386.jpg'
));
// output the response
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($curl);
print_r($result);
curl_close($curl);
?>
Can anyone explain me with my current code don't work ? It should return a url like this : http://www.noelshack.com/2016-XX-XXXXXXXXXX-2386.png
But it didn't return anything. There aren't any error in my code, the file is juste not uploaded, and i don't know why because i don't know how to display api errors !
Thanks in advance
(sorry for my english, i'm french)