Differences between multipart/form-data and application/X-WWW-form-urlencoded

Source: Internet
Author: User
In the form Element syntax, enctype indicates the format of the submitted data.

Use the enctype attribute to specify the encoding type used by the browser when data is sent back to the server.
Below is the description:
Application/X-WWW-form-urlencoded: Form data is encoded as name/value pairs. 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.
 
 
 
Supplement
  the enctype attribute of form is encoded in two ways:  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 in the HTTP body and sends it to the server.
if no type = file control exists, use the default application/X-WWW-form-urlencoded .
however, if type = file exists, multipart/form-data is required. 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, plus the delimiter

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.