哪个 OpenFeign 客户端标头有效?

问题描述

在下面的代码中,唯一包含的头是 D.. 我想包含的标题是静态的,所以我宁愿使用其他方法之一!有什么想法吗?

import feign.Headers;
import feign.Response;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

@RefreshScope
@Headers("A: a")
public interface FeignClientX {

    @Headers("B: b")
    @RequestMapping(value = "/api/",method = RequestMethod.GET,headers = "C: c")
    Response getFee(@RequestHeader("D") String token);
}

日志:

 ---> GET https://localhost/api/stuff HTTP/1.1
[DEBUG] [2c98d243b8c7e7db,2c98d243b8c7e7db,false] 2021-01-07 17:08:24.938 [http-nio-80-exec-1] RavencoinFeeBackupClient - [FeignClientX#getFee] User-Agent: xxxxxxxx
[DEBUG] [2c98d243b8c7e7db,false] 2021-01-07 17:08:24.938 [http-nio-80-exec-1] RavencoinFeeBackupClient - [FeignClientX#getFee] ---> END HTTP (0-byte body)
[DEBUG] [2c98d243b8c7e7db,false] 2021-01-07 17:08:25.269 [http-nio-80-exec-1] RavencoinFeeBackupClient - [FeignClientX#getFee] <--- HTTP/1.1 200 OK (330ms)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)