zoukankan      html  css  js  c++  java
  • Spring Coud OpenFeign动态设置请求头Header

    这种方案目前不生效(版本: feign-core-10.4.0.jar),虽然注解时Feign包下的,但是不生效,可能是哪里没配置对。

    @FeignClient(url = "https://xxx.com", name = "sensetime")
    public interface SensetimeFeign {
      @Headers({"Authorization: {Authorization}"})
      @PostMapping(path = "/xxx", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
      String silentImageVerification(@Param("Authorization") String signature);
    }

    使用SpringBoot web注解(生效)

    @FeignClient(url = "https://xxx.com", name = "sensetime")
    public interface SensetimeFeign {
      @PostMapping(path = "/xxx", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
      String silentImageVerification(@RequestHeader("Authorization") String signature);
    }
  • 相关阅读:
    coredata
    去除XIB上UITextView光标垂直居中问题
    IOS 开发使用SVN
    CSS层叠样式表--找到标签
    简单的爬虫
    HTML
    13索引
    12事务
    12内建函数
    11存储过程
  • 原文地址:https://www.cnblogs.com/laeni/p/12733920.html
Copyright © 2011-2022 走看看