-4

In pre requesite script ,send a request and it is giving 200 status code and res.json() used but it is showing undefined

I tried var r =res.json() console.log(r) but it is giving undefined

1 Answers1

0

You can't access a response in a pre-request script (it is executed before the request is sent), you need to use the tests tab:

var j = pm.response.json();
console.log(j);
Oriol Vilaseca
  • 317
  • 3
  • 7