Enctype is the encoding type used by the browser when data is sent back to the server. The encoding types include:
1. Application/X-WWW-form-urlencoded
This is the default encoding type when data is sent through a form. When the enctype attribute is not set in the from label, the default value is application/X-WWW-form-urlencoded. The application/X-WWW-form-urlencoded encoding type encodes the data sent in the form into name/value pairs. This is the standard encoding format. When the form action is post, the browser encapsulates form data into the HTTP body and sends it to the server. When the form action is get, the application/X-WWW-form-urlencoded encoding type converts the data sent in the form into a string (name = coderbolg & Key = PHP ), then append the string to the end of the URL and use? Split, and then request the new URL. When sending an Ajax request to the server in post mode, we 'd better specify the request header as the application/X-WWW-form-urlencoded encoding type. The method is added after the xmlobject. open () method
xmlHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded")
Otherwise, the server will not receive post data.
Ii. multipart/form-Data
This is specially used to transmit special types of data, such as non-text content uploaded by us, such as slice or mp3. This encoding type is not character encoding. Data is transmitted to the server in binary format. In this case, if the request cannot directly obtain the value of the corresponding form, the stream object should be used, decodes binary data uploaded to the server to read the data.
Iii. Text/plain
The data is encoded in plain text, without any controls or format characters.