Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the difference between form-data, x-www-form-urlencoded, raw and binary in postman

2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces "what is the difference between form-data, x-www-form-urlencoded, raw and binary in postman". In daily operation, I believe many people have doubts about what is the difference between form-data, x-www-form-urlencoded, raw and binary in postman. Xiaobian consulted various materials and sorted out simple and easy operation methods. I hope to answer your doubts about "what is the difference between form-data, x-www-form-urlencoded, raw and binary in postman". Next, please follow the small series to learn together!

When you use postman to send data to the backend interface, you will find that there are four options for you to choose from, as shown in the figure:

What is the difference between these four formats?

1、form-data:

This is multipart/form-data in http requests, which processes the data of the form into a message, separated by tags and separators. You can upload key-value pairs or files. When the uploaded field is a file, there will be Content-Type to describe the file type;content-disposition to describe some information of the field; due to boundary isolation, multipart/form-data can upload both files and key-value pairs. It adopts key-value pairs, so multiple files can be uploaded.

You can see that all the information passed is processed into a single piece and divided by a boundary, which is a random string. Used to verify data.

2、x-www-form-urlencoded:

That is, application/x-www-from-urlencoded, will convert the data in the form into key-value pairs. When simulating the form to upload data, use this option, but of course this form cannot upload files, only text format. To upload files, use the above format. For example,name=java&age = 23

You can see that content-type is application/x-www-form-urlencoded

3、raw

You can upload text in any format, you can upload text, json, xml, html, etc., in fact, the main or pass json format data, when the backend requires json data format, we must use this format to test.

4、binary

Equivalent to Content-Type:application/octet-stream, literally known, only binary data can be uploaded, usually used to upload files, because there is no key, so only one file can be uploaded at a time. This is not very common, understand it.

Note the difference between multipart/form-data and x-www-form-urlencoded:

multipart/form-data: You can upload binary data such as files or form key-value pairs, but it will eventually be converted into a piece of information;

x-www-form-urlencoded: Only key-value pairs can be uploaded, and the key-value pairs are separated.

At this point, the study of "what is the difference between form-data, x-www-form-urlencoded, raw and binary in postman" is over, hoping to solve everyone's doubts. Theory and practice can better match to help everyone learn, go and try it! If you want to continue learning more relevant knowledge, please continue to pay attention to the website, Xiaobian will continue to strive to bring more practical articles for everyone!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report