Javascript: Fetch DELETE and PUT requests

Here is a fetch POST example. You can do the same for DELETE. function createNewProfile(profile) { const formData = new FormData(); formData.append(‘first_name’, profile.firstName); formData.append(‘last_name’, profile.lastName); formData.append(’email’, profile.email); return fetch(‘http://example.com/api/v1/registration’, { method: ‘POST’, body: formData }).then(response => response.json()) } createNewProfile(profile) .then((json) => { // handle success }) .catch(error => error);

PHP cURL HTTP PUT

Just been doing that myself today… here is code I have working for me… $data = array(“a” => $a); $ch = curl_init($url); 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); if (!$response) { return false; } src: http://www.lornajane.net/posts/2009/putting-data-fields-with-php-curl

How do I enable HTTP PUT and DELETE for ASP.NET MVC in IIS?

Go to Handler Mappings in your IIS Manager. Find ExtensionlessUrlHandler-Integrated-4.0, double click it. Click Request Restrictions… button and on Verbs tab, add both DELETE and PUT. EDIT: Possible WebDav Publisher issue You’ve mention on a deleted post you were running on a 2008 server right? Try removing webDav role, or disable it from your site … Read more