We will often see the content-type attribute in http.
The content-type attribute has this attribute in the HTTP request header and response header.
Generally, we use chrome to access a url, such as http://www.baidu.com
You can see that the Response headers have the following properties, note that the request headers have no content-Type
Look at the content-type of the request headers. This format generally includes multipart/form-data, application/x-www-form-urlencoded, application/json,
Among them, application/x-www-form-urlencoded is the default value for form submission. For get and post requests, browsers will process the request data parameters differently. Multipart/form-data is mainly used for file uploading. And application/json is used more now, and the parameters are directly passed to the server in json format. In the java code, the server obtains it through request.getInputStream, and application/json can also be used for response headers, telling the client that this is a Data in json format, most restful apis are in this format.