feign client multipart feign调用服务上传图片 报错 the request was rejected because no multipart boundary was
2018-02-21 22:23
537 查看
学习spring cloud ,些了一个图片上传的服务,直接用postman 请求这个服务,是没有问题的,
但是在web层(comsumer层?)用feign去调用这个服务,就报错了,,
the request was rejected because no multipart boundary was found,,,
原文地址: https://github.com/OpenFeign/feign-form
工程中需要依赖这两个东东
<dependencies>
...
<dependency>
<groupId>io.github.openfeign.form</groupId>
<artifactId>feign-form</artifactId>
<version>3.2.2</version>
</dependency>
<dependency>
<groupId>io.github.openfeign.form</groupId>
<artifactId>feign-form-spring</artifactId>
<version>3.2.2</version>
</dependency>
...
</dependencies>
但是在web层(comsumer层?)用feign去调用这个服务,就报错了,,
the request was rejected because no multipart boundary was found,,,
原文地址: https://github.com/OpenFeign/feign-form
工程中需要依赖这两个东东
<dependencies>
...
<dependency>
<groupId>io.github.openfeign.form</groupId>
<artifactId>feign-form</artifactId>
<version>3.2.2</version>
</dependency>
<dependency>
<groupId>io.github.openfeign.form</groupId>
<artifactId>feign-form-spring</artifactId>
<version>3.2.2</version>
</dependency>
...
</dependencies>
@FeignClient(name = "file-upload-service", configuration = FileUploadServiceClient.MultipartSupportConfig.class) public interface FileUploadServiceClient extends IFileUploadServiceClient { public class MultipartSupportConfig { @Autowired private ObjectFactory<HttpMessageConverters> messageConverters; @Bean public Encoder feignFormEncoder() { return new SpringFormEncoder(new SpringEncoder(messageConverters)); } } }
@FeignClient(name = "file-upload-service", configuration = FileUploadServiceClient.MultipartSupportConfig.class) public interface FileUploadServiceClient extends IFileUploadServiceClient { public class MultipartSupportConfig { @Bean public Encoder feignFormEncoder() { return new SpringFormEncoder(); } } }
相关文章推荐
- XHR异步上传文件报错: “the request was rejected because no multipart boundary was found”
- 使用postman模拟上传文件到springMVC的坑:the request was rejected because no multipart boundary was found
- the request was rejected because no multipart boundary was found??求解
- struts上传图片过大限制:the request was rejected because its size (2407044) exceeds the configured m
- the request was rejected because its size (***) exceeds the configured maximum (2097152) 上传不成功
- struts2出现 the request was rejected because its size (XXXX) exceeds the configured maximum (XXXX)
- dhl:The request for security token could not be satisfied because authentication failed. 调用方未由服务进行身份验证。
- Jenkins RestAPI调用出现Error 403 No valid crumb was included in the request
- Struts中the request was rejected because its size (***) exceeds the configured ma
- the request was rejected because its size (4652587) exceeds the configured maximum (2097152)
- struts2出现 the request was rejected because its size (XXXX) exceeds the configured maximum (XXXX)
- 关于文件上传遇到的问 no multipart boundary was found
- the request was rejected because its size ..exc
- org.apache.commons.fileupload.FileUploadBase$UnknownSizeException: the request was rejected because its size is unknown
- 在使用springmvc上传图片 The current request is not a multipart request 错误
- 浅谈对struts2.2 the request was rejected because its size (XXXX) exceeds the configured maximum (XXXX)错
- 在使用springmvc上传图片时碰到的 The current request is not a multipart request问题
- Spring mvc 上传图片遇到The current request is not a multipart request的问题
- Struts中the request was rejected because its size (***) exceeds the configured ma
- Spring mvc 上传文件,报The current request is not a multipart request