1: the form data

Content-Type:multipart/form-data;
Copy the code
<form action="${pageContext.request.contextPath}/imageUpload_saveOrUpdate.action" method="post" enctype="multipart/form-data"> <div> <label> Please select the address to upload the image :</label> <inputtype="file" name="image"/> 
</div> 
</div> 
<div> 
<input type="submit" value="Upload"/> 
</div> 
</form> 
Copy the code

It processes the form’s data into a message, grouped by labels and separated by delimiters. You can upload both key-value pairs and files. When the uploaded field is a file, the content-Type is used to specify the file type. Content-disposition, which specifies some information about the field; Because of boundary isolation, multipart/form-data can upload both files and key-value pairs. Multipart /form-data uses key-value pairs, so it can upload multiple files.

2: x – WWW – form – urlencoded

application/x-www-from-urlencoded

3: Raw Can upload any format of text, such as text, JSON, XML, and HTML

Binary: content-type :application/octet-stream binary :application/octet-stream binary: content-type :application/octet-stream

Multipart /form-data differs from X-www-form-urlencoded

Multipart /form-data: you can upload binary data, such as files, as well as form key-value pairs, which will be converted into a message. X-www-form-urlencoded: Only key-value pairs can be uploaded, and key-value pairs are spaced apart.Copy the code

Reference []