I have seen HTTP methods written in all caps and in all lowercase letters. Is there any reason why you would want to write POST
rather than post
i
Short answer: use lowercase in method
attributes of <form>
tags because the standard only allows lowercase.
Long answer: It slightly depends on the HTML version:
HTML5: The standard clearly sates that lowercase get
maps to the HTTP method GET and that lowercase post
maps to HTTP method POST [1]. And these are the only values mentioned there, attribute values are case sensitive and an enumerated attribute allows only the values mentioned in the standard. The examples in the HTML5 standard also use lowercase. So, if you want to follow HTML5 standard, use lowercase. In practice, it is not a problem to use uppercase with HTML5 though, and I have seen more usage of uppercase recently. Still, I don't see any reason why this should be good practice, as the standard states it otherwise.
XHTML: Use lowercase. The DTD of xhtml-strict and xhtml-transitional only define lowercase get
and post
[2, 3]. Here its is even more important, as using uppercase will produce an invalid XHTML document that can trigger ugly browser errors in practice (depends on DTD, browser and http content-type).
HTML 4: In these days, it was common practice to use uppercase, but lowercase also worked well in practice. This is just my personal experience, I am not going to look up the HTML 4 standard as it seems irrelevant nowadays (and nobody ever followed it strictly anyways).
W3Schools also uses lowercase [4].
[1] https://www.w3.org/TR/html5/forms.html#attr-fs-method
[2] https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd line 695
[3] https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd line 888
[4] https://www.w3schools.com/tags/att_form_method.asp
Your site will work fine whether you use POST or post in your form's method declaration. It has more to do with the doctype you choose. If you use XHTML, everything must be lowercase. If you do not (and use HTML5 for example) it does not matter and can even be PoSt if you like. I personally still would go for the lowercase variant but the choise is yours. Whatever you choose, the important thing is...stick with it in the rest of your page.
The HTML5 spec requires to use "get" or "post".