HTTP method: The difference between a GET request and a POST request

Source: Internet
Author: User
Tags html header


Get is a request to send data to the server, and post is a request to submit data to the server
Get is to get information, not modify information, like database query function, data will not be modified
The parameters of the GET request will be passed after the URL, the requested data will be appended to the URL, in order to split the URL and transfer data, the parameters are connected with &, the XX in%xx for the symbol in 16 binary ASCII, if the data is English letter/number, as is sent, if it is a space, Convert to +, if it is Chinese/other characters, then encrypt the string directly with BASE64.
The data for a get transfer has a size limit, because get is submitting data through a URL, so the amount of data that get can commit is directly related to the length of the URL, and different browsers have different limits on the length of the URL.
Get request data will be cached by the browser, the user name and password will appear in plaintext on the URL, others can find historical browsing records, the data is not very safe. On the server side, use Request.QueryString to get the data submitted by the Get method
The POST request is sent to the Web server as the actual content of the HTTP message, the data is placed within the HTML header, and the post does not restrict the submitted data. Post is safer than get, when the data is in Chinese or not sensitive data, then use GET, because use GET, parameters will be displayed in the address, for sensitive data and not Chinese characters of data, then use post
Post represents a request that may modify resources on the server, and the data submitted by post can only be obtained by using Request.Form on the server side.

HTTP method: The difference between a GET request and a POST request

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.