How to write PHP curl DELETE request
<p>I'm referencing DigitalOcean's API docs, and they give the following example on how to delete a droplet here:</p>

<pre><code>curl -X DELETE -H "Content-Type: application/json" -H "Authorization: Bearer API_TOKEN" "https://api.digitalocean.com/v2/droplets/[DROPLET_ID]"
</code></pre>

<p>How can I write this in PHP curl?</p>

<p>I currently have this:</p>

<pre><code>$ch = curl_init('https://api.digitalocean.com/v2/droplets/18160706');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Authorization: Bearer MY_API_TOKEN')
);

$result = curl_exec($ch);
echo $result;
</code></pre>

<p>But that is not deleting my droplet and is returning (Yes, the droplet id is correct):</p>

<pre><code>{"id":"not_found","message":"The resource you were accessing could not be found."}1
</code></pre>