简体   繁体   English

春云伪装文件上传

[英]Spring-cloud feign file upload

I am trying to upload a file with feign client in spring-boot application. 我正在尝试在spring-boot应用程序中使用伪装客户端上传文件。 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 ;) 在此先感谢您,我的英语不好;)

First of all, I have not used Feign before. 首先,我以前没有使用过Feign。 When i google it, I found an information about feign. 当我在Google上搜索时,我发现了有关假冒的信息。 Look at here Feign Client (Section 5) 在这里查看虚假客户 (第5节)

It says : Feign clients can be used to consume text-based HTTP APIs only, which means that they cannot handle binary data, eg file uploads or downloads. 它说:虚假客户端只能用于使用基于文本的HTTP API,这意味着它们无法处理二进制数据,例如文件上载或下载。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM