最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

rest - IntelliJ Http client: Conditional header - Stack Overflow

programmeradmin5浏览0评论

I want to use the Intellij Http client to do some HTTP requests. I have different environments. On one of them, I want to login with a JWT and on the other with OAuth2. Both need different headers. I want to set one of the headers based on the environment I chose, but I can find a option for that.

My request looks like this:

GET {{URL}
Authorization: {{JWTTOKEN}}
AuthorizationOAuth: Bearer {{$auth.token("oauth")}}

I couldn't find a way to only provide the Authorization header if I use environment1 and the AuthorizationOAuth header if I use environment2. Is this even possible in any way?

发布评论

评论列表(0)

  1. 暂无评论