When an HTML form is submitted without specifying a method, what is the default HTTP method used? GET or POST?
Has this behaviour ever changed between HTML standards?
Please cite a W3C standard document if possible.
When an HTML form is submitted without specifying a method, what is the default HTTP method used? GET or POST?
Has this behaviour ever changed between HTML standards?
Please cite a W3C standard document if possible.
It's GET.
Take a look here.
Excerpt:
Good read
Methods GET and POST in HTML forms - what's the difference?
(fuller answer, also about action and enctype)
The default 'method', 'action' and 'enctype' of an HTML form, if they are not specified, are
GET, current URL and
application/x-www-form-urlencoded
respectively.(I.e., by default, a form requests current page with the inputted parameters.)
This behaviour has never changed, except 'action' (in HTML 4 it was required). Citations:
method: "The missing value default for the method attribute is... the GET state."
action:
enctype: "The missing value default for the enctype attribute is... the
application/x-www-form-urlencoded
state."method: "Possible (case-insensitive) values are 'get' (the default) and 'post'."
action: no default, DTD requires it
enctype: "The default value for this attribute is 'application/x-www-form-urlencoded'."
method: "It can be either GET or POST, and defaults to GET."
action: no explicit sentence, only in DTD
enctype: "It defaults to application/x-www-form-urlencoded."
method: no explicit sentence, only in DTD
action: "The action URI of a form defaults to the base URI of the document"
enctype: "The default encoding for all forms is `application/x-www-form-urlencoded'."
According to The W3C standard you're asking for, the default should be GET.
If not specified, the default is GET. I see no indication that this behaviour has ever been different. And it makes sense the GET is the default, as it specifies that method should be used for actions without side effects.
http://www.faqs.org/faqs/www/cgi-faq/section-37.html
Citations from http://www.w3.org/TR/html401/interact/forms.html#h-17.3:
Here is the W3C reference, which says GET is the default.