Required request part ‘file‘ is not present
将MultypartFile name 设为 接口参数。
MultipartFile multipartFile = new MockMultipartFile("file", fileName, ContentType.MULTIPART.toString(), new FileInputStream(file)); return this.fileUploadFeign.handleFileUpload(multipartFile);
定义feign接口:
@PostMapping(value = "/v1/files", consumes = "multipart/*", headers = "content-type=multipart/form-data")
String handleFileUpload(@RequestPart("file") MultipartFile file);