WebAPI學習筆記(8)Postman中Binary和Form-data上傳文件區別


官方解釋如下:

 

Binary data

Binary data allows you to send things which you can not enter in Postman, for example, image, audio, or video files. You can send text files as well.

 

Form-data

multipart/form-data is the default encoding a web form uses to transfer data. This simulates filling a form on a website, and submitting it. The form-data editor lets you set key-value pairs (using the data editor for your data.) It also lets you specify the content type for each part of a multi-part form request individually. You can attach files to a key as well.

When you repeatedly make API calls that require sending these files again and again, Postman persists your file paths for subsequent use. This also helps you run collections that contain requests requiring file upload.

Uploading multiple files each with their own Content-Type is not supported yet.

 

主要區別在於:

1. Binary每次只能傳一個附件,而Form-data可以傳多個。

2. Form-data可以利用key-value對,可以分別對每個文件進行描述。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM