GET vs POST for ASP form submission

GET and POST both send form data to the server, but they are designed for different kinds of requests. The right choice depends on whether the request is retrieving a resource, changing server state, carrying sensitive data, or needs a bookmarkable URL.

TopicGETPOST
Where form data appearsQuery string in the URLRequest body
Bookmark/shareParameters can be bookmarked and sharedBody is not represented in the URL
Typical useRead/search/filter/navigation requestsSubmitting changes, forms, larger request bodies
Browser historyURL including parameters may remain in historySubmitted body is not part of the history URL
Sensitive dataDo not put passwords or secrets in the URLStill requires HTTPS; POST by itself does not encrypt data
ASP collectionRequest.QueryStringRequest.Form

Choose GET for retrievable resources

GET is useful for search terms, filters, paging values, product IDs, and other parameters that describe the resource being requested. These URLs can often be shared or bookmarked.

Choose POST for submitted changes

POST is normally better for creating or changing data, contact/login forms, or larger form submissions. However, hiding a value from the URL is not a security mechanism. Use HTTPS and appropriate server-side controls.

URL length is not a fixed 255-character rule

Older tutorials often state that GET has a universal 255-character limit. There is no single practical limit that applies to every browser, proxy, web server, and application. Keep query strings reasonably small and use POST when a form naturally carries a larger body.

Encode and validate input

Browsers encode form parameters for transport, but the receiving application must still validate submitted values. When request data is later written into HTML, HTML-encode it for that output context.


ASP Home



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.



✖
We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
© 2000-2026 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer