vscode-restclient
vscode-restclient copied to clipboard
Added support for percent-encoding variables when referenced
Problem
This almost certainly doesn't do what you want, because the & will not get percent-encoded:
@name = Strunk & White
GET https://{{host}}/authors/{{name}}
However, we can't assume we should always percent-encode the value of a variable.
So we need some sort of helper.
Proposed Solution
New syntax for referencing a file variable: {{%foo}} This tells us to percent-encode the value.
Example:
@name = Strunk & White
GET https://{{host}}/authors/{{%name}}
@Huachao Any thoughts?
@Huachao I support adding this functionality! Very useful when getting tokens from a response that contains characters that require escaping.
@someparam = abcd&efgh
GET https://localhost/abc?p={{%someparam}}
@kibiz0r Merged, thanks. And it will be published in the next release