OpenFeign组装请求头Header
组装单个Header参数
@RequestHeader("Authorization") String token
组装多个Header参数
@PostMapping(value = "/a/b", headers = {"Content-Type=application/json", "a=AAAAAA", "b=BBBBB"})
Object createSth(@RequestBody Model model);
待验证方案
/**
* chatgpt给出的方案,笔者使用发现无效,原因未知
*/
@Headers("Authorization: Bearer {token}")
@RequestLine("GET /api/user")
User getUser(@Param("token") String token);