java - 带有 MultiValueMap 的 Spring Cloud Feign 版本 2020.04 问题
问题描述
下面是我要调用的端点。
@PostMapping(value = "test",
consumes = MULTIPART_FORM_DATA_VALUE)
Response addVariable(MultiValueMap<String, Object> body);
它在 SpringFeign Hoxton.SR1的早期版本中运行良好。使用当前版本,我从服务提供商处收到 500 错误。服务提供商没有任何变化,并且在以前的版本中仍然可以正常工作。
> <html> <head> <meta http-equiv="Content-Type"
> content="text/html;charset=utf-8"/> <title>Error 500 Request
> failed.</title> </head> <body><h2>HTTP ERROR 500 Request failed.</h2>
> <table> <tr><th>URI:</th><td>/test</td></tr>
> <tr><th>STATUS:</th><td>500</td></tr> <tr><th>MESSAGE:</th><td>Request
> failed.</td></tr>
> <tr><th>SERVLET:</th><td>org.camunda.bpm.spring.boot.starter.rest.CamundaJerseyResourceConfig</td></tr>
> </table> </body> </html> workflow-services
> a1d051de-f70e-4248-900c-2c5c2d6d5cc0 W586159 - 2021.11.13 15:52:06.835
> [http-nio-7071-exec-2] <--- END HTTP (522-byte body)
> ------------------------------------------------------------------------
无代码更改..仅从 2.2.4.RELEASE 升级版本-- > 2.5.6
由于在新版本的弹簧编码器中添加了额外的更改,代码正在中断。
if (Objects.equals(requestContentType, MediaType.MULTIPART_FORM_DATA)) {
this.springFormEncoder.encode(requestBody, bodyType, request);
return;
}
解决方案
推荐阅读
- javascript - GraphQL 的突变上的“意外的令牌 < 在 JSON 中的位置 0”
- flutter - 如何使用盒子阴影显示容器的高度,如抽屉(更多深度 z 轴)?
- visual-studio - 复制 +,, 没有按预期工作:文件被触摸但也被复制
- javascript - asp.net 代码不调用 javascript 函数
- java - 如何在 Java 中实现构建特定的注解保留
- php - 我无法在 Godaddy 服务器上使用 CURL
- amazon-web-services - DynamoDB 多对多等效
- excel - 如何在 VBA 中自动填充函数?
- xcode - Macos 应用程序在 Xcode 中显示视图,但在 Xcode 之外启动时完全空白
- docker - 如何在 Jenkins 全局工具配置中配置 Ansible?