Sending a PUT request with query parameters in the URL
$PostData = [
'param1' => 'value1',
'param2' => 'value2'
];
$Url = "mydomain.org/somefile.php";
$Url .= '?' . http_build_query($PostData); //Append query parameters to URL
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $Url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT"); //This is a PUT request
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); //Follow any page redirects etc (optional)
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //<<<Include this for the output of curl to go to the curl_exec() output below instead of the browser screen
$CurlResult= curl_exec($ch);
//If your output is json then you can decode it with this:
$DecodedJson = json_decode($CurlResult);
echo "CurlResult: ";
print_r($CurlResult);
echo "<br>DecodedJson: ";
print_r($DecodedJson);
