3 ms·
Yes, but application developers have long faked it using GET .../thing?op=DELETE When you get sick of faking it you look into why there is no way to get browse
by adrianratnapala 8y ago
Yes, but application developers have long faked it using GET .../thing?op=DELETE
When you get sick of faking it you look into why there is no way to get browser to send real DELETEs and PUTs and w3c verbiage says "because application developers don't seem to need it" ... because they fake it ... because they have to fake it ... because browser don't do it ... because devs don't need it ...
- runarberg 8y agoI was gonna write a snarky comment about using a <button formmethod="DELETE"> but apparently, the only methods allowed on a <form>s and <button>s are GET and POST. I wonder why these limitations. Especially since you can get past this with an: button.addEventHandler('click', () => { fetch('/path/to/resource', { method: 'DELETE' }) }); which seems way less accessible then to have the method there right there as an attribute.
- adrianratnapala 8y agoThough as dragonwriter points out, using a button+POST to fake a delete is much better than using a link. Api-wise that's a reason to mux your puts and deletes in the POST handler and not in the GET handler, since it force the HTML to use buttons rather than links that might get crawled.
- runarberg 8y agoI still don’t understand why: <button formmethod="POST"> is better then: <button formmethod="DELETE"> When the former actually calls DELETE behind the scenes. I would think a crawler would prefer the latter, except for the fact that it is invalid (!)