哪个openfeign客户端头工作?

9bfwbjaz  于 2021-06-27  发布在  Java
关注(0)|答案(0)|浏览(189)

在下面的代码中,唯一包含的头是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,2c98d243b8c7e7db,,false] 2021-01-07 17:08:24.938 [http-nio-80-exec-1] RavencoinFeeBackupClient - [FeignClientX#getFee] ---> END HTTP (0-byte body)
[DEBUG] [2c98d243b8c7e7db,2c98d243b8c7e7db,,false] 2021-01-07 17:08:25.269 [http-nio-80-exec-1] RavencoinFeeBackupClient - [FeignClientX#getFee] <--- HTTP/1.1 200 OK (330ms)

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题