I need to do a PUT request sending json data, I wrote the code below but the data are not sent. Can someone help?
$url = 'https://example.com';
$data='{"example":"valor"}';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_PUT, 1);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
$result = curl_exec($curl);
print_r($result);
thanks