Request Variables
Request variables are variables that are scoped to a specific request. They are useful for storing variables that is used in a specific request.
Note: With the release of v1.28.0, we’ve shifted to treating all Request Variables as strings instead of inferring the data type from the value. See discussion (opens in a new tab) for more information.
Creating a Request Variable
- Go to the Request
- Go to Vars Tab
- Add your variable name, value in the Pre Request Vars section
- Save your changes
Using a Request Variable
You can use the {{varName}}
syntax to use a request variable in a request.
Access Request Variable inside scripts
You can also use the bru.getRequestVar()
function to get the value of a request variable and use it inside your scripts.
let source = bru.getRequestVar("source");
let destination = bru.getRequestVar("destination");