Except HTML(5) forms do not support any methods other than GET and POST.
Except HTML(5) forms do not support any methods other than GET and POST.
A DELETE has no payload.
OPTIONS and HEAD make no sense for a browser, because there is no information to show to the user.
So that leaves us with POST and GET. As I already stated, POST is the best form to send user data to a server. And a form with GET is just an URI builder.
Edit: Well no, that does not leave us with POST and GET, because there are also CONNECT and TRACE. But who wants to concern a user with those?
You can still use other HTTP methods from a browser (using XmlHttpRequest), just not through a form.
Because not supporting Get would break a lot of current web applications and html5 had a pretty clear goal of being mostly backwards compatible. The previous form element didn't restrict the method and GET and POST are used everywhere. Restricting GET would have caused too much confusion to be worth it.
The author was ranting about unused features, but not all features are good ideas. Sometimes things that look good on paper don't work so well in practice.
Those who forget SOAP are doomed to recreate it, badly. I worry that things like JSON-schema are headed in that direction.
* Until recently, used stateful numbers for all links * Uses the same location for different resources (e.g. https://news.ycombinator.com/item) * Serves the same resources at multiple different locations, rather than redirecting you to a canonical location. * Does posting, editing and deleting via POST, not CREATE/PATCH/DELETE * Does approximately no content negotiation * Does not support non-browser clients at all, which, well I suppose you could make a perverse argument that that is HATEOAS.
In short, it behaves not at all like the system described in the REST paper.
Can you substantiate that? Why shouldn't I be able to POST a new resource to a server and update an existing resource with PUT using Forms? Why shouldn't I be able to delete a resource using a DELETE method using a Form?
Doesn't make sense to me.
I would not use such a framework, because it did not understand HTTP and HTML specs in the first place.
I'm not sure what you're talking about:
1) It's user input and the user can craft a DELETE request just as well as add a _method=DELETE to the form body.
2) Most frameworks use the _method parameter as the http method, meaning when routing or when the application asks for the method so as to take specific actions. No general framework just deletes or creates stuff for you (unless you specifically set it up to, and even then you can normally add an authorization check hook).
The reason HTML uses an enumeration ("get" and "post") and maps those to HTTP methods ("GET" and "POST") is that they have special meaning for user interaction. With "get" a form becomes an URI builder. With "post" the user can send data to the server. You can call it a coincidence that the values of the enumeration match the HTTP methods. The reason a "post" form is mapped to a HTTP POST is that a server should always process user inputs - even if the behavior of your application results in deleting a resource.
So yes, okay, the frameworks behave correctly, because they process user inputs. My point was to question the intent or reason behind a "_method" parameter of those frameworks. If such a framework invented the parameter because it felt limited by the HTML specification, it did not understand the specification. If it is about automating resource management, then I'm fine with that.
BTW. which frameworks do you mean? I know none (never saw that in Spring Web or WS RS implementations like Jersey).