I want to learn how HTTP PUT method is used with PHP?
I googled at the web and found some tutorials about it with cURL.
But I dont know how to use it (Like REST API).
I want to learn how HTTP PUT method is used with PHP?
I googled at the web and found some tutorials about it with cURL.
But I dont know how to use it (Like REST API).
$data = array("field" => "value");
$ch = curl_init($yourUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
$response = curl_exec($ch);