1

I have back-end API to allow user POST a json_body and with a file:

@RequestMapping(value = "/sendemail",
            method = RequestMethod.POST,
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE,
            consumes = {MediaType.MULTIPART_FORM_DATA_VALUE}
)
public @ResponseBody ResponseEntity<String> sendEmailToClients(
       @RequestBody String jsonData,
       @RequestParam(value = "file", required = false) final MultipartFile file) {
        ...
}

Question: On Postman Tool, Is there any way to make a POST for sending out json_body and file upload?

ρяσѕρєя K
  • 132,198
  • 53
  • 198
  • 213
Trong Tran
  • 676
  • 1
  • 8
  • 22
  • 1
    Possible duplicate of [Tool for sending multipart/form-data request](http://stackoverflow.com/questions/16015548/tool-for-sending-multipart-form-data-request) – luk2302 Jan 13 '17 at 09:42
  • No, I mean I want to send a POST for both json body and file. I know that I can send a file and add some url's parameters. Or I can send a json body with some url's parameters. – Trong Tran Jan 13 '17 at 09:57
  • This is unclear, update your question please – AxelH Jan 13 '17 at 10:15
  • I've updated the question. Pls help, thanks! – Trong Tran Jan 16 '17 at 01:58

0 Answers0