多部分请求

时间:2015-09-06 17:05:14

标签: java spring-mvc multipartform-data

我有多部分请求的方法

@RequestMapping(method = RequestMethod.POST)
public @ResponseBody ResponseEntity<Photo> updatePhoto(@RequestHeader(value="Access-key") String accessKey,
                                     @RequestHeader(value="Secret-key") String secretKey,
                                     @PathVariable("file") MultipartFile file)

当我在没有内容类型的postman中测试它时:multipart / form-data标题,当它与它一起工作时我会

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.web.multipart.MultipartException: Could not parse multipart servlet request; nested exception is org.apache.commons.fileupload.FileUploadException: the request was rejected because no multipart boundary was found

为什么会这样?

0 个答案:

没有答案