...
Code Block |
---|
$url = 'http://maboutique.com/api/images/products/1'; $image_path = '[C:\\mon_image.png]'; $key = '[Ma clé webservice]'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, true); //curl_setopt($ch, CURLOPT_PUT, true); Pour modifier une image curl_setopt($ch, CURLOPT_USERPWD, $key.':'); curl_setopt($ch, CURLOPT_POSTFIELDS, array('image' => '@'.$image_path)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $result = curl_exec($ch); curl_close($ch); |