小编D R*_*D R的帖子

在 Springboot 1.5.4.RELEASE 中使用 Feign @HeaderMap 不会发送标头

我正在尝试使用 feign.HeaderMap 注释在其余请求中传递 HTTP 标头映射,但这些标头出现在正文中。

代码如下:

@FeignClient(name = "accounts", url = "localhost:8080") 公共接口 AccountClient {

@RequestMapping(method = RequestMethod.GET, value = "/rest/accounts/get", produces = MediaType.APPLICATION_JSON_VALUE)
Account findOne(@RequestParam("id") String id, @HeaderMap Map headers);
Run Code Online (Sandbox Code Playgroud)

}

spring-boot spring-cloud-feign

2
推荐指数
1
解决办法
2571
查看次数

标签 统计

spring-boot ×1

spring-cloud-feign ×1