The difference between get and post methods in Form submission 1. Get is to get data from the server, and post is to send data to the server. 2. Get is to add the parameter data queue to the URL referred to by the Action attribute of the submission form. The values correspond to each field in the form one by one and can be seen in the URL. Post uses the http post mechanism to place fields in the form and their content in the HTML header and send them to the URL address referred to by the Action attribute. You cannot see this process. 3. For the get method, the server uses request. querystring to obtain the value of the variable. For the POST method, the server uses request. Form to obtain the submitted data. 4. The data volume transmitted by get is small and cannot exceed 2 kb. The amount of data transmitted by post is large, which is generally not restricted by default. Theoretically, the maximum size of IIS4 is 80 KB, and that of iis5 is 100kb. 5. Low get security and high post security. In the form Element syntax, enctype indicates the encoding type used by the browser when the data is sent back to the server using the enctype attribute. Application/X-WWW-form-urlencoded: the form data is encoded as a name/value pair. This is the standard encoding format. Multipart/form-data: the form data is encoded as a message. Each control on the page corresponds to a part of the message. Text/plain: the form data is encoded in plain text format, which does not contain any controls or format characters. The enctype attribute of form is supplemented by the encoding method. There are two common types: Application/X-WWW-form-urlencoded and multipart/form-data, the default value is application/X-WWW-form-urlencoded. When the action is get, the browser uses the X-WWW-form-urlencoded encoding method to convert form data into a string (name1 = value1 & name2 = value2 ...), then append the string to the end of the URL, using? Load the new URL. When the action is post, the browser encapsulates form data into the HTTP body and sends it to the server. If there is no type = file control, use the default application/X-WWW-form-urlencoded. However, if type = file exists, you need to use multipart/form-data. The browser splits the entire form into controls and adds content-disposition (Form-data or file) and Content-Type (text/plain by default) to each part ), name (Control name) and other information, with a separator
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.