vscode-restclient icon indicating copy to clipboard operation
vscode-restclient copied to clipboard

Environment-dependent headers

Open lucianmoldovanu opened this issue 2 years ago • 0 comments

Is there a feature/roadmap to support environment-dependent headers?

I have multiple environments that I need to switch between, and only one of these environment requires a particular header parameter. If I keep this header parameter for other environments, this leads to erroneous behavior.

Intuition-wise, I would expect to do this either via a conditional expression (how?) in the request: GET {{hostDSO}}/dso_materials/MaterialsStage x-approuter-authorization: Bearer {{token}} {{ environment=='local' ? {x-other-parameter: value} : null }

or alternatively via some environment-dependent headers in "rest-client.defaultHeaders".

Yet again, these are just my thoughts. Can you please help out to indicate if this is available or planned?

Kind regards, Lucian

lucianmoldovanu avatar Apr 21 '22 09:04 lucianmoldovanu