POST vs post, GET vs get

I realize that both will work, but is one more correct than the other?

<form method="POST" />

vs.

<form method="post" />

Why use one or the other?


Solution 1:

W3C has tended towards lowercase for attribute names and values for a while.

For example section 4.11 of the xhtml 1.0 standard in 2002:

4.11. Attributes with pre-defined value sets

HTML 4 and XHTML both have some attributes that have pre-defined and limited sets of values (e.g. the type attribute of the input element). In SGML and XML, these are called enumerated attributes. Under HTML 4, the interpretation of these values was case-insensitive, so a value of TEXT was equivalent to a value of text. Under XML, the interpretation of these values is case-sensitive, and in XHTML 1 all of these values are defined in lower-case.

Solution 2:

You can use either of them why because HTML is not case-sensitive markup language.

See HTML 4.01 Specification

The value is case-insensitive (i.e., user agents interpret "a" and "A" as the same).


Note that XHTML should be lower case.

4.2. Element and attribute names must be in lower case

XHTML documents must use lower case for all HTML element and attribute names. This difference is necessary because XML is case-sensitive e.g. <li> and <LI> are different tags.

Solution 3:

Either way is fine for HTML. There is not specific recommendation.

Possible (case-insensitive) values are "get" (the default) and "post".

There are arguments for both uppercase and lowercase. One could say that the default for HTML (and mandatory for XHTML) tokens is to write them in lowercase, but saying that the values used in HTTP requests are the uppercase ones is equally valid.

Solution 4:

Either is fine. It's not case sensitive. w3schools implies the w3c recommends lower case for HTML: http://www.w3schools.com/html/html_attributes.asp

Here is the w3c XHTML lower-case requirement for attributes: http://www.w3.org/TR/xhtml1/#h-4.2