在用postman 请求这个调用接口的时候,报了the request was rejected because no multipart boundary was found
1.首先检查是否导入了下面两个包
io.github.openfeign.form feign-form 3.2.2 io.github.openfeign.form feign-form-spring 3.2.2
2.再检查一下feign接口是否有如下参数
@PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
public R upload(@RequestPart(value = "file") MultipartFile file);
重点
请求体必须是@RequestPart这个注解,
并且consumes=MediaType.MULTIPART_FORM_DATA_VALUE
因为源码里面content-type会被",“或”;"进行转换为Map,在org.apache.tomcat.util.http.fileupload.FileUploadbase.FileItemIteratorImpl#FileItemIteratorImpl抛出异常,所以大家一定要注意jar包版本问题。



