Spring Cloud Feign 上传文件时报错:Current request is not a multipart request
1.检查前端请求头中的Content_Type
Content-Type设置成multipart/form-data,检查后发现前端的请求没有问题。
2.文件的注解要用@RequestPart
3.添加consumes = MediaType.MULTIPART_FORM_DATA_VALUE
@RequestMapping(value = "productingRecord/uploadExcel", method = RequestMethod.POST,consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
public ResponseEntity<CommonResponse<Long>> uploadExcel (@RequestPart("file") MultipartFile file , HttpServletRequest request)