Several common content-types

Content-type function:
    In the request (such as POST or PUT), the client tells the server that the type of data actually sent is
    in the response, and the Content-Type header tells the client the content type of the content actually returned, so that it can be processed accordingly

1. The value type of Content-Type:

    1.1 application/json: The body of the message is a serialized JSON string

    1.2 application/x-www-form-urlencoded: data is encoded as name/value pairs. This is the standard encoding format (form submission & ajax default, both get and post)

    1.3 multipart/form-data: When you need to upload files in the form , you need to use this format. Common media formats are used when uploading files

    1.4 text/plain: data is encoded in plain text form (text/json/xml/html) without any controls or formatting characters

Guess you like

Origin blog.csdn.net/weixin_38230961/article/details/103157505