Add support for variables
Closed this issue · 3 comments
In large requests, it is difficult to find places in the request body and insert appropriate values. It would be much more convenient if one can put variables instead and on the first few lines of the request file, set their values.
Something like ${date}
notation inside the request where on the first line of the .http
file I can write: #date=20200202
That's probably a little outside of the scope of what this plugin is trying to achieve.
Could you not just use your ${date}
place holders and :%s/\${date}/20200202/g
it? if you used #
or !
or &
you wouldn't need to escape anything.
Closing for now, shout at me if you feel that it needs to be reopened.
I'm also interested in this feature. It would be great to parameterize a set of requests that e.g. makes it easy to switch the target host using a single variable rather than in all requests of a file.
This is how the VS Code REST client extension works, and I think it's a desirable feature that would be nice here as well
https://github.com/Huachao/vscode-restclient