4 ms·
With that logic, why do forms support GET then?
by cozuya 12y ago
With that logic, why do forms support GET then?
- zaphar 12y agoI am of course guessing here. It's possible that I'm completely wrong since I've never been in the working group and don't really know anyone on the working group. But given what I've read publicly this seems like a likely explanation: 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.
- olavk 12y agoGET is the most appropriate method for many forms, eg. search interfaces. It is not just a question of backwards compatibility.
- gnaritas 12y agoBecause input fields aren't necessarily input, they can be query parameters as well. A GET form is a query builder.
- djur 12y agoThere was a time when GET forms were pretty common for search interfaces. It still works fine, but I think the sentiment against 'ugly' URLs mostly wiped them out.
- olavk 12y agoAren't GET forms still the default choice for search engines like Google? Otherwise you couldn't bookmark a search.
- olavk 12y agoGET in forms is useful for query interfaces, eg. a search engine. A search should be safe, idempotent and all parameters encoded in the URL. GET is the correct choice for that.