GET v POST

F

Fat Bloke

I expect this has been asked a zillion times...

Why should I use GET instead of POST?
 
J

Jukka K. Korpela

Fat Bloke said:
I expect this has been asked a zillion times...

But you didn't bother checking the archives or FAQs? In effect, you are
then asking to be misled. Even if some people cared to repeat the
correct answers, how would you distinguish them from the ubiquous
bogosity, especially in a group that is regularly trolled?
Why should I use GET instead of POST?

What makes you think you should use GET instead of POST?
 
D

Dylan Parry

Jukka said:
What makes you think you should use GET instead of POST?

My interpretation of the question is "what are the reasons why one would
choose either GET or POST?" Of course, this is only _my_
interpretation, and the OP could have meant something entirely different.
 
A

Andy Dingley

It was somewhere outside Barstow when Fat Bloke
Why should I use GET instead of POST?

Because GET is bookmarkable.

Because you can. There are lots of things you _shouldn't_ do from a
GET, particularly things which aren't idempotent (i.e. they change
things or have side effects). If you're outside the cases though, you
have a pretty free hand as to which you use. You're often forced to
use POST, but not always.

It's typical practice that links cause a GET, form submission causes a
POST. However if the form's result permits it (i.e. it's idempotent)
then this can be a good target for turning into a GET. If you're
writing a complex interactive application (typically an intranet,
where users gain a lot of experience with this particular app) then
the easier navigation of GET (bookmarking, simpler refresh) can be
worth having.
 
A

Adrienne

Gazing into my crystal ball I observed Fat Bloke
I expect this has been asked a zillion times...

Why should I use GET instead of POST?

GET method puts the name/value pairs into a querystring in the URL. If
the name/value pairs are sensitive, eg. usernames and/or passwords, then
don't use that method. If you application needs to get information out
of a querystring, eg. <a href="example.com/somefile.asp?page=3&amp;sort=
1"> then GET method is the way to go.

POST method does not write name/value pairs to a querystring, and can
therefore be used for sensitive data such as username and/or passwords
(but should not be the only method used). POST method also allows larger
chunks of data to be passed than querystrings.
 
T

Toby Inkster

Fat said:
Why should I use GET instead of POST?

From a visitor's perspective, there's two types of form:

1. Forms where the visitor is providing information. Examples are "contact
us" forms, content management forms, login forms, order forms, guest books.

2. Forms where the visitor is requesting information. Examples are search
forms, currency converters.

In general, almost any form on a web page comes into one of those two
categories. Occasionally, you find a form that's a bit of both, but that's
not very common.

In the first case, the form is the important bit -- not the results page
-- so you don't need or want the results page to be bookmarkable, so it's
generally desirable to use POST.

In the second case, the results page is the important bit, so you want it
to be bookmarkable, so use GET.

So decide which type of form you have, and base your choice of GET or POST
on that.
 
F

Fat Bloke

Thanx to all (well, most) of you. It was refreshing to read genuine
attempts to help clarify an issue instead of the strictures of the
self-appointed policemen.
 
J

Jukka K. Korpela

Fat Bloke said:
Thanx to all (well, most) of you.

You're welcome.
It was refreshing to read genuine
attempts to help clarify an issue instead of the strictures of the
self-appointed policemen.

So you preferred making people post the explanations once again as well
as wait for some time to get some of them, and getting _less_
explanations that you would have got if you had checked the archives
and FAQs. Your choice.

And you posted a completely useless and mildly insulting message to a
worldwide forum, instead of adding anything to previous discussions.
Consider yourself plonked. HTH. HAND.
 
R

R2G2

You're welcome.


So you preferred making people post the explanations once again as well
as wait for some time to get some of them, and getting _less_
explanations that you would have got if you had checked the archives
and FAQs. Your choice.

And you posted a completely useless and mildly insulting message to a
worldwide forum, instead of adding anything to previous discussions.
Consider yourself plonked. HTH. HAND.

Stupid question, maybe, but where do I find the FAQs?
 
F

Fat Bloke

So you preferred making people post the explanations once again as well
as wait for some time to get some of them, and getting _less_
explanations that you would have got if you had checked the archives
and FAQs. Your choice.

And you posted a completely useless and mildly insulting message to a
worldwide forum, instead of adding anything to previous discussions.
Consider yourself plonked. HTH. HAND.
No worries, sunshine.
I have the perfect job for you, suit you down to the ground - the writers of
the European Constitution have need of pedants.
Why don't you just put me in your kill file? - and then we'll all be merry
and bright!
 
D

DU

Fat said:
No worries, sunshine.
I have the perfect job for you, suit you down to the ground - the writers of
the European Constitution have need of pedants.
Why don't you just put me in your kill file? - and then we'll all be merry
and bright!


You do not seem to understand. Every single day, there are questions
posted in this newsgroup (and other web programming newsgroup) which
have been asked zillions times and which have been answered a few
millions times. So, people decided to write FAQs to best meet those
zillions of postings regarding the same issues/questions/problems. So
how come you have not started to search for some FAQ on that particular
issue certainly seems a fair reaction to a wide majority of reasonable
people.

I think Jukka was correct in pointing out (maybe in an admonishing or
abrasive manner) that you should have searched for the issue rather than
requesting to be (what appeared to most of us) "spoon-fed".

DU
 
F

Fat Bloke

You do not seem to understand. Every single day, there are questions
posted in this newsgroup (and other web programming newsgroup) which
have been asked zillions times and which have been answered a few
millions times. So, people decided to write FAQs to best meet those
zillions of postings regarding the same issues/questions/problems. So
how come you have not started to search for some FAQ on that particular
issue certainly seems a fair reaction to a wide majority of reasonable
people.

I think Jukka was correct in pointing out (maybe in an admonishing or
abrasive manner) that you should have searched for the issue rather than
requesting to be (what appeared to most of us) "spoon-fed".

DU
I understand perfectly well; what *he* does not understand is that anything
he doesn't like, he can ignore. What he should not do is set himself up as
some kind of newsgroup inspector - that is asking, positively *asking*, for
a suitably robust response. It is, however, perfectly in line with the
attitude he displays in his verbose and seemingly-endless pronouncements on
what he has decided is wrong with css, html and the net (that is, the net in
general where it is not the net-as-according-to-korpela). I meantersay,
have you *read* his website pages (or, rather, tried to)? I started, but
life's just too short for some things, so I had to deny myself the
pleasure...
To display at least some form of uniformity, he should seek out and answer
each and every post in this group with the same helpful "Read the docs,
dummy" litany. I repeat, anything he doesn't like, he can ignore. 's dead
easy, that; takes a little self-discipline to refrain, mind you, with the
consequent loss to his vanity which this would involve, but it... can...
be... done.

However, all this is academic becos the self-appointed policeman has
apparently "plonked" me; clearly, in the face of such a terminal
condemnation, there remains little for me to do but crawl away and sob
silently in imitation of some soft, furry, forest animal in distress.
OhmiGawd..... how can I face the Vicar after this?
 
J

Joel Shepherd

[Snip 1k or so of long-winded "Jukka Sucks" whining.]
I repeat, anything he doesn't like, he can ignore.

As long as you're repeating yourself, perhaps you should take your own
advice. Sheesh.
 
F

Fat Bloke

[Snip 1k or so of long-winded "Jukka Sucks" whining.]
I repeat, anything he doesn't like, he can ignore.

As long as you're repeating yourself, perhaps you should take your own
advice. Sheesh.
You never learn, do you?
'scuse me while add *you* to my killfile, too.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,432
Messages
2,571,681
Members
48,796
Latest member
Greg L.

Latest Threads

Top