Form-data, x-www-form-urlencoded, raw, binary meaning of body in postman

body

1、form-data

Equivalent to multipart/form-data in the http request, it will process the data of the form into a message, with tags as units and separated by delimiters.

You can upload both key-value pairs and files

When the uploaded field is a file, there will be Content-Type to name the file type; content-disposition to describe some information about the field.

Due to boundary isolation, multipart/form-data can upload both files and key-value pairs. It adopts the method of key-value pairs, so multiple files can be uploaded.

insert image description here

2、x-www-form-urlencoded

Equivalent to application/x-www-from-urlencoded in the http request, it will convert the data in the form into key-value pairs, for example, grant_type=authorization_code&code=Z7cOp8&client_id=client1&client_secret=123456&redirect_uri=http%3A%2F%2Fbaidu.com&scope =test

3、raw

You can upload text in any format, including text, json, xml, html, etc.
insert image description here

4、binary

It is equivalent to Content-Type: application/octet-stream. From the literal meaning, only binary data can be uploaded, which is usually used to upload files. Since there is no key value, only one file can be uploaded at a time.
insert image description here

Guess you like

Origin blog.csdn.net/weixin_45525272/article/details/123471401