0
votes

I am trying to upload a file with feign client in spring-boot application. I want to set encoder with the following condition:

if (bodyType.equals(MultipartFile.class)){
   // run multi-part logic
} else {
   // Delegate to default encoder.
}

I am not able to delegate the control again on default encoder. Can someone help me to find out the solution. I would be highly appreciated.

Thanks in advance and sorry for my poor english ;)

1
I don't get your point. Just a suggestion from experience, feign uploading file does not work very well and github.com/OpenFeign/feign-form might help - user2256235
Does rest-client work for upload multi-part file? - Cool Java guy מוחמד
Yes, restTemplate can help to upload file - user2256235

1 Answers

0
votes

First of all, I have not used Feign before. When i google it, I found an information about feign. Look at here Feign Client (Section 5)

It says : Feign clients can be used to consume text-based HTTP APIs only, which means that they cannot handle binary data, e.g. file uploads or downloads.