PHP 8 , PHP
Today,I will learn you how to create curl delete request example in php. We will show example of curl delete request in php. Hear we will show you how to call curl with delete. wh have create one function it will call cutl methods DELETE in a RESTful API. this code and post will helped you for implement how to call curl with delete.
The delete request is very simple again. We can just hit the API url with the $id we want to remove and poof… it’s gone forever.
$url = "https://api.mywebtuts.com/api/users/2";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
It will help you...