[thelist] What is the Difference between post and get?

Morbus Iff morbus at disobey.com
Fri Apr 27 14:11:57 CDT 2001


 >>Okay, dumb question but I am creating some forms and was just 
wondering >>the difference between post and get was for the method 
attribute? Also, >>is the proper time for each to be used?
 >
 >POST puts the form values into the headers of the HTTP communication, GET
 >puts the form values into the URL string. GET is limited to about 256
 >characters (usually a browser limitation) and creates really ugly URLs.
 >POST allows you to have extremely dense forms and pass that to the server
 >without clutter or limitation in size. e.g. you obviously can't send a file
 >from the client to the server via GET.

I agree with Anthony. Semantically, GET is supposed to *return* information 
from the server. I may be talking out my butt, but (ha!) I could have swore 
there was some RFC or recommendation that said "Use GET to retrieve 
information. Use POST *only when you* planning on changing something via 
the script (working with files, etc.)."

Emphasis is my own.

When you think about security, the above makes sense. If GET encodes the 
junk into the URL, and the junk messes with some data on the server in a 
"gonna change you, poo poo kachoo" sort of way, then that's bad, since 
anyone could modify the URL to give values you weren't expecting.

For that reasoning, GET should be used for common form scripts that email 
more information to the filler-outer or the owner (since it changes nothing 
on the server), POST should be used for guestbook types of things (since it 
changes a file on the server).

Yup.

Morbus Iff
.sig on other machine.
http://www.disobey.com/
http://www.gamegrene.com/





More information about the thelist mailing list