Using VSCode Rest Client - How do you pass the value of a variable between variables?
@varA = “123”
@varB = “234”
@varFinal = varA
currently it doesn’t pass the value, it sets varFinal to the static string ‘varA’ - I want it to be ‘123’
You have to include variable inside double bracket like "{{variableName}}". In the above scenario, you could change the expression as shown below
@varA = 123
@varB = 234
@varFinal = {{varA}}
In the below example, I am storing "swapi.co" in variable "host". Further I am assigning "host" variable to "host1" and using in my http request.
@host = swapi.co
@host1 = {{host}}
GET https://{{host1}}/api/planets/ HTTP/1.1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With