Solved

Get and Post

Posted on 1998-08-18
3
177 Views
Last Modified: 2010-03-05
I remember seeing somewhere a brief, if somewhat simplified explanation of which method was best in which situation. I've looked on a lot of faq sites, but can't find anywhere that contrasts the two. Could anyone fill me in?
Cheers
0
Comment
Question by:AndrewThomason
3 Comments
 

Expert Comment

by:brunovan
ID: 1204388
use post to send it as input to a script, and use get to send it to a file.

Bruno
0
 

Author Comment

by:AndrewThomason
ID: 1204389
To brief
0
 
LVL 1

Accepted Solution

by:
evilgreg earned 80 total points
ID: 1204390
Short answer:
GET is quick and efficient, but very limited.
POST is a little harder to implement, but more secure (and nice looking) and handles more data.

(This isn't really a perl question, per se, but...)

GET advantages:
- It's short and quick
- You can see all the data that is going to be submitted.
- It can be put into a link, and no FORM tags are necessary.
- It's real easy to change the input, especially when testing a new form

GET disadvantages:
- All the data is world viewable (see any search engine for an example)
- It can form really long, ugly URL's
- It severly limits the amount of data that can be sent

POST advantages:
- Data is not world viewable
- Short, sweet URLs. The same URL can do many different things.
- Send as much data as you want

POST disadvantages:
- Harder to debug your apps (although this is easy to get around)
- Harder to code for the client (HTML) and for the server (cgi)

Generally, GET should be used for short, quick inquiries (again, see the search engines). For more than a few fields or a few lines of data, use POST.

Because GET data gets shoved into an environment variable (QUERY_INFO), it has a finite limit on how much data can be sent it. It's a lot, but I find it personally "cleaner" to just use POST most of the time, in which the data becomes stdin and can hold as much as you want.

Some good times to use GET:
Search forms
Simple redirects

Some good times to use POST:
Long user input forms
Sending data between forms
Hiding previous data cleanly with the INPUT TYPE=HIDDEN tag.

A final caveat, it really does depend on the exact situation: the amount of data, how comfortable you are with each type, how important speed is, how important "nice looking" URLs are, etc...

0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now