[Note] the difference between Asp.net post and get

Source: Internet
Author: User

PostAnd getDifferences:

Post: Form submission, used to transmit data to the server.

Get: String submission (only ASCII characters). It is used to obtain data from the server. (It is the default form method)

Post: it implicitly submits your form data and can transmit a large amount of data. Therefore, you can only use post to upload files.
Get: displays all the data submitted to your form data in the URL. The amount of data transmitted is small.

Get: This page is regarded as a new page, so (the page status will be lost) The viewstate will be gone.
Post: This page will not be regarded as a new page. You should pay attention to this viewstate when using it.

The real difference between post and get is that they have different functions. Post is designed to put up (as its name implies ); get is designed to fetch things from the server, so it can also transmit a small amount of data to the server, so that when you get things, you need to specify what to take, sometimes, we use a mechanism to specify what to take to place things on the server.
For the above reason, the post and get methods are different in HTTP transmission. The GET parameters are transmitted in the HTTP header, the post data is transmitted in the HTTP request content. In general, we do not see the difference in the middle, because the programming environment (such as servlet) helps us to hide the difference.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.