Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 957
Explosion Pills Avatar asked Nov 05 '10 14:11

Explosion Pills


People also ask

When to use a POST vs GET?

Use GET if you want to read data without changing state, and use POST if you want to update state on the server.

Which is better GET or POST method?

GET performs are better compared to POST because of the simple nature of appending the values in the URL. It has lower performance as compared to GET method because of time spent in including POST values in the HTTP body. This method supports only string data types.

Why is POST better than GET?

GET is less secure compared to POST because data sent is part of the URL. So it's saved in browser history and server logs in plaintext. POST is a little safer than GET because the parameters are not stored in browser history or in web server logs.

Which is fast GET or POST?

GET is slightly faster because the values are sent in the header unlike the POST the values are sent in the request body, in the format that the content type specifies.


2 Answers

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.

like image 92
amelvin Avatar answered Sep 22 '22 02:09

amelvin


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.

like image 30
Sarfraz Avatar answered Sep 22 '22 02:09

Sarfraz