Question: GET vs POST method

  • Thread starter Thread starter VB Programmer
  • Start date Start date
V

VB Programmer

Can someone provide a simple explanation on the difference between the GET
and POST methods? What are the adv/disadv of both and when should I use
them?

Thanks.
 
Hi

Get and Post are methods used to send data to the server:
With the Get method, the browser appends the data onto
the URL. With the Post method, the data is sent
as "standard input."


It's important for you to know which method you are
using. The Get method is the default, so if you do not
specify a method, the Get method will be used
automatically.

The Get method has several disadvantages:
There is a limit on the number of characters which can be
sent to the server, generally around 100 - 150
characters.
Your user will see the "messy codes" when the data is
sent.

The Bottom Line is With the Get method, your users will
see the "messy codes" in the Location box when they
submit a form. With the Post method, they won't


Hope this gives an idea

Ravikanth[MVP]
 
VB said:
Can someone provide a simple explanation on the difference between
the GET and POST methods? What are the adv/disadv of both and when
should I use them?

Thanks.

In addition to Ravikanth's posting:

Use GET:
- during development for debugging purposes (although in ASP.NET it's
also easy to see what has been sent through POST.
- if you want your visitors to be able to bookmark the submitted pages
- if you want to refer to submitted pages using hyperlinks

Use POST:
- for forms with password fields
- for large forms or forms with large text fields

Please note that web forms in ASP.NET use POST by default. It can be
changed into GET, but only for small forms. Web forms can post a lot
of data, especially when ViewState is involved.
 
GREAT response! Thanks.

Jos said:
In addition to Ravikanth's posting:

Use GET:
- during development for debugging purposes (although in ASP.NET it's
also easy to see what has been sent through POST.
- if you want your visitors to be able to bookmark the submitted pages
- if you want to refer to submitted pages using hyperlinks

Use POST:
- for forms with password fields
- for large forms or forms with large text fields

Please note that web forms in ASP.NET use POST by default. It can be
changed into GET, but only for small forms. Web forms can post a lot
of data, especially when ViewState is involved.
 
You should also use POST for all requests that result in changes on the
server (such as updating the database). Clients will automatically resubmit
GET forms but not POST forms if the user refreshes the page (or goes back to
it in their history).

Jerry
 
Back
Top