Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

347
Views
responseBody is not defined in Postman

I have JSON like below:

{
    "success": true,
    "code": 200,
    "message": "Success",
    "data": [
        {
            "ID_A": "AXCS-1-1",
            "ID_B": "AXCS-1-1",
            "Number": "11009988"
        }
    ]
}

And my script for testing in postman:

var data = JSON.parse(responseBody);

if(responseCode.code === 200){
    pm.environment.set("IdA",data.data[0].ID_A);
    pm.environment.set("IdB",data.data[0].ID_B);
}

And I get the response:

How to fix this?

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

The error says responseBody is not defined and the error is from prerequest script

responseBody is a global object that contains the response , this variable is available only in test script , and as pre-request is executed before the request is even send, requestBody variable wont be accessible

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!