Home > database >  Postman with "body" (json) and files (multipart) together in 1 restful request
Postman with "body" (json) and files (multipart) together in 1 restful request

Time:12-30

How do I use Postman to send queries with body (in json format) and files (in multipart) format at the same time?

I think I should use Postman->Body->Raw although I can't find an example on the Web. Anyone can kindly teach me? Thank you!

CodePudding user response:

In postman, set method type to POST.

Then select Body -> form-data -> Enter your parameter name (file according to your code)

On the right side of the Key field, while hovering your mouse over it, there is a dropdown menu to select between Text/File. Select File, then a "Select Files" button will appear in the Value field.

For rest of JSON data, you can click on raw and enter your JSON data there.

enter image description here

  • Related