3 ms·
I once searched for a way to send PUT requests using HTML forms because I despise using JS for core functionality but still wanted to build a nice REST API. Som
by sgeisler 7y ago
I once searched for a way to send PUT requests using HTML forms because I despise using JS for core functionality but still wanted to build a nice REST API. Somehow I stumbled across XForms which was part of XHTML2 and supports PUT and DELETE only to find out that no browser supports it.
Now I hope that the form extensions proposal [1] will gain some traction.
[1] http://cameronjones.github.io/form-http-extensions/index.html http://cameronjones.github.io/form-http-extensions/index.htm...
- hlandau 7y agoThe most common "solution" for this is to add middleware on the server-side which accepts a form parameter "_method" which supercedes the real HTTP method. I believe Rails uses this.
- sgeisler 7y agoI'm aware of this workaround, but it's still a sad state of affairs, especially since POSTs have to be handled with more care because they aren't idempotent. So the browser will warn the user if they really want to resend the query if something goes wrong the first time.