The difference between get and post

Source: Internet
Author: User

use JS to turn the post into get mode, and then to the Index.asp page to receive passed parameters on it!
It is recommended to submit data using the form Method!
the Get and post methods in the form, respectively, correspond to the Get and post methods in the HTTP protocol during data transfer. The main differences are as follows:
1, get is used to obtain data from the server, and post is used to pass data to the server.
2. Get adds the data in the form in the form of Variable=value, followed by the URL to which the action points, and both use "?". connections, and each variable is connected by a "&" connection; Post is the data in the form that is placed in the data body of the forms, in the same way that the variables and values are passed to the URL that the action points to.
3, get is not safe, because in the transmission process, the data is placed in the requested URL, and now many existing servers, proxy servers or user agents will log the request URL to the journal file, and then put in a place, so that there may be some privacy information to be seen by third parties. In addition, users can see the submitted data directly in the browser, and some system internal messages will be displayed in front of the user. All the actions of the post are not visible to the user.
4, get transmission of small amount of data, mainly because of the URL length limit, and post can transfer a large amount of data, so the upload file can only use post (of course, there is a reason, will be mentioned later).
5. Get restricts the value of the data set for form forms to be ASCII characters, while Post supports the entire ISO10646 character set.
6, get is the default method for form.
Summary: Get: The URL string itself to pass data parameters, on the server side can be directly read from the ' query_string ' variable, high efficiency, but lack of security, also can not handle complex data (only string, such as in servlet/ JSP can not handle the use of Java, such as vector functions);
Post mode: In terms of transmission mode parameters will be packaged in the datagram transmission, read from the environment variable content_length, easy to transfer the larger data, and because the data is not exposed in the browser address bar, the security is relatively high, but such processing efficiency will be affected.

The difference between get and post

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.