How to send a PUT/DELETE request in jQuery?
You could use the ajax method: $.ajax({ url: ‘/script.cgi’, type: ‘DELETE’, success: function(result) { // Do something with the result } });
You could use the ajax method: $.ajax({ url: ‘/script.cgi’, type: ‘DELETE’, success: function(result) { // Do something with the result } });
HTTP PUT: PUT puts a file or resource at a specific URI, and exactly at that URI. If there’s already a file or resource at that URI, PUT replaces that file or resource. If there is no file or resource there, PUT creates one. PUT is idempotent, but paradoxically PUT responses are not cacheable. HTTP … Read more
NOTE: When I first spent time reading about REST, idempotence was a confusing concept to try to get right. I still didn’t get it quite right in my original answer, as further comments (and Jason Hoetger’s answer) have shown. For a while, I have resisted updating this answer extensively, to avoid effectively plagiarizing Jason, but … Read more