Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is POST better than GET?

Status
Not open for further replies.

meeble3

Programmer
Joined
Nov 8, 2004
Messages
52
Location
GB
Why use one rather than the other if they both do the same thing?

Thanks
 

Post is better in the logn run for many reasons, not least that you cas pass a lot more data through to the server than with the get method.

Hope this helps,
Dan


[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
Using post also keeps the data out of the URL. All the user sees is the web page address itself, not the fields you are passing to it.


Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
The one good thing about GET is that it allows you to bookmark the results page.

Do a google search for anything and then check out the URL that appears in your address bar. You can make a shortcut directly to the results page if you wish.

But, overall, POST is better.
 
>The one good thing about GET is that it allows you to bookmark the results page
Or the bad thing depends on how you look at it. The way tsdragon put it gets the both side of the story covered.
 
The rule of thumb... use POST when you want to send or "post" data to a server, like submitting an application form. POST can handle sending a lot more data.

Use GET when you want to retrieve or "get" data from a server, like search results or database record data. Only send the key data needed to retrieve what you want, like a unique ID. Then that data will be in the URL if the user want to bookmark the page.

Adam

Whatever I feel like I wanna do, gosh!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top