0

In a pre-request script I want to set a variable to use then in my request.

Let's say my pre-request script looks like this:

var token = "x"

variables.set("token", token);

And if I want to use the variable {{token}} in the request itself, I am getting error:

Request failed to set 'body' — Variable 'token' was not defined

iczcezar
  • 1
  • 1

1 Answers1

0

Found that it's not possible due to: "Setting a variable in a pre-request script does not make the value available to the currently request step", which is a pity

iczcezar
  • 1
  • 1