Postman simulates POST method to upload files

1. Set request headers

1) Create a new POST request;
2) Fill in the URL path of the interface that needs to be called; 3) Because you are uploading a file, you need to set the Content-Type
in the request header to multipart/form-data ! ! !

Insert image description here


2. Set the Body

1) Select the Body type as form-data ;
2) If there is a text parameter , select the KEY type as Text (the default is Text);
3) If you need to upload a file , select the KEY type as File , and VALUE displays " Select Files" ”, click “Select Files” to select the files to be uploaded.
Insert image description here
Insert image description here

3. Call effect

Insert image description here


PS:

IntelliJ IDEA simulates POST method to upload files, you can refer to the following blog post:
https://www.cnblogs.com/miracle-luna/p/14146007.html


Guess you like

Origin blog.csdn.net/aikudexiaohai/article/details/133509839