POSTMAN for Multipart/form-data

phalco picture phalco · May 25, 2017 · Viewed 34k times · Source

How to use POSTMAN for Multipart/form-data which has customize header for testing my controller which takes 2 files as parameter (public ... controller( MultipartFile[] files))?

POST .... HTTP/1.1
.
.
.
---boundary123
Content-type:application/octet-stream
content-Disposition: form-data filenale="abc.txt" name="someuniquename"
[paylaod content](this is in xml format)
---boundary123
content-type:application/json
content-Disposition:form-data name="metadata"
{ID:"999"}
---boundary123

Answer

Afridi picture Afridi · May 25, 2017

enter image description here

Steps to use 'Multipart/form-data ' in Postman

  1. Create a new tab
  2. Insert controller Url
  3. Set method type as POST
  4. Under Body tab, select form-data
  5. For each key that is a file, set Value type as File