I'm working with Postman right now and I have to do a lot of requests, and in the body I'm passing a JSON content. I would like to know if is there a way to pass the value of a global variable into JSON body. Thank you.
58
votes
5 Answers
80
votes
7
votes
I think what you want to do is described here.
To use a variable you need to enclose the variable name with double curly braces – {{my_variable_name}}.
5
votes
1
votes
Yep, double curly brackets is the way to go to achieve this - make sure you have the latest version of Postman (though if you are still running 2014 code when this feature was introduced, shame on you!)
eg:
{
"variable": "{{value}}"
}
See the second paragraph here in the Variables section of the documentation - it specifically mentions the request body.