2

I have created a one rest service for uploading file. My service consume Stream for file and Map of String for some info.

@RequestMapping(value = "/upload" , method = RequestMethod.POST)
public void upload(InputStream file,Map<String, String> fileInfoMap) {}

If yes then how to call service with POSTMAN? if not then please suggest some alternatives?

G10
  • 118
  • 1
  • 8

2 Answers2

0

add multipart/mixed content_type in postman , under body section select form-data like below attached imageenter image description here

enter image description here

aravindKrishna
  • 440
  • 2
  • 11
0

Try with postman if that doesn't work try curl

curl -i -X POST -H "Content-Type: multipart/mixed" -F "fileInfoMap="name=xxx&age=24&location=yyy";type=application/x-www-form-urlencoded" -F "file=@somefile.zip" http://localhost:8080/upload
aravindKrishna
  • 440
  • 2
  • 11