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.
Difference between GET and POST
issues | GET | POST |
Browser History | Data remain in Browser History | Data Not available in Browser History |
Bookmark | URL with Data can be bookmarked | No data is available in URL to bookmark the page |
Data Length Restiction | The restriction (of URL ) is applicable | No Restriction |
cached | Can be cached | No meaningful caching |
Sensitive Data | Data like password , pin etc are exposed through URL so they should not be passed using GET method | Better than GET method as data is not exposed through URL |
Advantage of using GET method
one can store the name value pairs as bookmark and directly use them by bypassing the form.
It is easier to pass the id of a record like product id or student id through query string and get the relevant details.
This article is written by plus2net.com team.
Number of User Comments : 21
plus2net.com
|
Naghu | 07-04-2010 | Really its a wonderful explanation ...
thank you...;) |
girish | 13-04-2010 | simple and understandable for a novice like me :), great mini article. Keep it up, Thanks. |
reema sharma | 15-04-2010 | wow!!i knew the difference but wanted to be sure..really all my doubts are gone..very detailed explanation...thank u. |
Akhil Jain | 28-04-2010 | It is really very good explanation, in HCL interview, interviewer asked me this question & that time I was not sure but after reading it I am confident that next time will not confuse with Get & Post. Thanks once again |
Pawan Kaushal | 11-05-2010 | It is a very simple and understandable article for any stage asp.net programmer. |
vishnu | 27-05-2010 | good....nice explanation of GET method,but still no explanation of POST method in the above context.
Kindly take care of this also. :) |
Batool | 06-06-2010 | very well explained. Thanks for the share. God Bless you! |
khushbu | 23-06-2010 | Short &n Simple, yet effectively explained & easy to understand... Keep it up!! |
nikhil | 28-06-2010 | to the point explanation , just what i was looking for .....!! :)
gud work . |
Amit sharma | 22-08-2010 | really very simple explanation very simple word are use plz put some focus on PUT method |
sunil kulkarni | 27-08-2010 | it is simple and mindblowing explanation. its look like simple but i gathered lots of information from this differentiation.. Thank you
|
gurmeet kaur | 29-09-2010 | thanks for explaning in so simple words and also do some focus on put method |
vandana | 21-10-2010 | explanation was good but for the post method should also b given....... |
Ganesh Mandlik | 25-11-2010 | Good Explanation, but its only about Get Method. |
satz | 29-07-2011 | yeah..its a very good article..but not explain Post method to enough level....Post method is used for security purpose. end user are not see the processing data.... |
MRT | 28-02-2012 | Good Explanation, and easy to understanding..! |
shailendra | 08-04-2012 | nice explanation of GET method,but where is explanation of POST method........sir |
zaty | 09-04-2012 | i find this very short but informative.nice!thank you:) |
Haseeb | 14-05-2012 | No this was not helpfull for me. you should tell more about the pros and cons of POST and GET |
anoop vaidya | 28-05-2012 | Having 5+ yrs exp in IT, i must say...superb way to explain. I am not in web developement so its difficult for me to grasp all these stuffs :p |
Sunil prajapati | 21-11-2012 | Nice explanation about get and post method my all doubt have gone. |
|
|