Several common types of content type



1) Browser’s native form form form

2) The submitted data is encoded in the way of key1 = val1 & key2 = val2, and both key and val are URL transcoded

3) The data is encoded as name / value pairs. This is the standard code case


When you need to upload files in the form, you need to use this format. Common media formats are used when uploading files


The message body is a serialized JSON string


It is a remote call specification that uses HTTP as the transmission protocol and XML as the encoding method


The data is encoded in plain text (text / JSON / XML / HTML) without any controls or formatting characters

#Difference between application / JSON and application / x-www-form-urlencoded


Function: tell the server that the subject content of the request is a string in JSON format, and the server will parse the JSON string,

Benefits: front end personnel do not need to care about the complexity of the data structure, as long as the standard JSON format can be submitted successfully.

application/x-www-form-urlencoded:Is jQuery’s default Ajax request mode

Function: in the request sending process, the data will be serialized in the form of key value pairs? Send it to the server by key1 = value1 & key2 = Value2

Benefits: all browsers support it