[thelist] GET vs. POST

Scott Schrantz scotts at rci-nv.com
Wed Feb 20 16:58:01 CST 2002


> -----Original Message-----
> From: Feingold Josh S [mailto:Josh.S.Feingold at irs.gov]
>
> When creating forms we have an option to use GET or POST
> methods.  I was
> wondering if there are any specific reasons that people use
> GET or POST or
> if it is just a matter of preference.  Are there any
> tradeoffs between the
> two?  Are there any differences with how the back button will
> work? Are there any other issues?

Off the top of my head:
GET puts all the results into the query string. This makes the submission a
little less secure, since everything you entered is visible right there on
the screen and it gets stored in your list of visited sites. But, this type
of query has advantages since it can also be bookmarked, copied and pasted
into e-mail, etc. It is meant to be used to GET data from, for example, a
search engine. You can they send that same query to your friends or to
TheList by including the query string in the URL.

POST hides all the data that is sent; none of it is visible on the screen
after it is sent. Only slightly more secure, though, since the results are
still transmitted in plain text. This type of query cannot be bookmarked,
and is usually meant to POST data once for storage on the server, such as
into a database application. A blog post or an online order form would be
examples of this one-time submission.

So, ideally, you would decide which one to use based on what you were going
to be doing with the data once the server receives it, if you want the
results page to be bookmarked, and if you want the same data to be able to
be passed around and easily resubmitted or not.



More information about the thelist mailing list