我有后端API,允许用户 POST a json_body
并使用文件:
@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) {
...
}
问题:在邮递员工具上,有没有办法让POST
发送json_body
和文件上传?