File Upload Using Feign - multipart/form-data

后端 未结 3 972
别那么骄傲
别那么骄傲 2020-12-03 18:30

I\'m trying to accomplish a multipart file upload using feign, but I can\'t seem to find a good example of it anywhere. I essentially want the HTTP request to turn out simil

3条回答
  •  醉梦人生
    2020-12-03 18:56

    If you are already using Spring Web, you can try my implementation of a Feign Encoder that is able to create Multipart requests. It can send a single file, an array of files alongwith one or more additional JSON payloads. Here is my test project. If you don't use Spring, you can refactor the code by changing the encodeRequest method in FeignSpringFormEncoder.

提交回复
热议问题