I have a remote service A which does the file upload. I have service B which calls the upload API of service A through FeignClient to upload a file
The method definition in Service A is something like
ResponseEntity<?> upload(@RequestPart("file") MultipartFile file) { }
And the method in Service B is
@FeignClient(url = "http://localhost:5000/")
public interface uploadService {
@RequestMapping(method = RequestMethod.POST, value = "/serviceA/upload")
@Headers("Content-Type: multipart/form-data")
void uploadFile(@RequestPart("file") MultipartFile file);
}
I am getting the error Content-Type "multipart/form-data" not set for request body of type StandardMultipartFile
I have tried most of the suggestions on https://github.com/spring-cloud/spring-cloud-netflix/issues/867 and https://github.com/OpenFeign/feign-form but nothing works for me