Difference between POST and Get Methods [Resolved]

Posted by Santhiram under ASP.NET on 4/24/2012 | Points: 10 | Views : 5277 | Status : [Member] | Replies : 5
How to decide when to use POST & when to use Get Methods?




Responses

Posted by: Sakthi.Singaravel on: 4/24/2012 [Member] Silver | Points: 50

Up
0
Down

Resolved
Difference in GET and FORM method in posting data

We can send data to the data processing page by both the GET and POST methods of a form. Both methods are used in form data handling where each one has some difference on the way they work. We will discuss some of the differences.

As you have seen there is a character restriction of 255 in the URL. This is mostly the old browsers restriction and new ones can handle more than that. But we can't be sure that all our visitors are using new browsers. So when we show a text area or a text box asking users to enter some data, then there will be a problem if more data is entered. This restriction is not there in POST method.

In GET method data gets transferred to the processing page in name value pairs through URL, so it is exposed and can be easily traced by visiting history pages of the browser. So any login details with password should never be posted by using GET method.

As the data transfers through address bar ( URL ) there are some restrictions in using space, some characters like ampersand ( & ) etc in the GET method of posting data. We have to take special care for encoding ( while sending ) and decoding ( while receiving ) data if such special characters are present.

There are some special cases where advantage of using GET method is , one can store the name value pairs as bookmark and directly use them by bypassing the form.

Source: http://www.plus2net.com/asp-tutorial/form-diff.php

Regards,
Singaravel M

Santhiram, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 4/24/2012 [Member] Silver | Points: 25

Up
0
Down
See this link for simple GET and POST method example...

http://triaslama.wordpress.com/2008/05/01/interacting-with-get-and-post-methods-in-aspnet/

Regards,
Singaravel M

Santhiram, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 4/24/2012 [Member] Silver | Points: 25

Up
0
Down

Nice Article for Choose GET or POST?

http://blog.thecodingmachine.com/content/get-or-post-best-practices-choosing-http-method

Regards,
Singaravel M

Santhiram, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Santhiram on: 4/25/2012 [Member] Starter | Points: 25

Up
0
Down
Thanks Sakthi.Singaravel.

Santhiram, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 4/25/2012 [Member] Silver | Points: 25

Up
0
Down
Welcome

Regards,
Singaravel M

Santhiram, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response