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

622
Views
Postman: where is the body in a pm.sendRequest()?

i am writing a pre-requist script in Postman in order to get a token. The post request goes fine from the console, but i can not find and parse it in the code.

const POSTtoken = {
url: 'http://localhost:888/api/login?username=THEanswere&password=42',
method: 'POST',
headers: {"Content-Type": "application/json"},
}


pm.sendRequest(POSTtoken,function(err, response){
   pm.globals.set("apiToken", response['apiToken']); /*HERE I HAVE THE PROBLEM*/
})

basically i would like to catch the body from the post request. Is there any mathod? i am missing something? and thanks in adnvace for the support.

FIND A SOLUTION.

I didi parsed the response.

basically:

pm.sendRequest(token,function(err, response){
    jsontoken= response.json()
    pm.globals.set("apiToken", jsontoken['apiToken']);
})

ill leave the solution hopefully is usefull to some one else.

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

FIND A SOLUTION.

I didi parsed the response.

basically:

pm.sendRequest(token,function(err, response){
    jsontoken= response.json()
    pm.globals.set("apiToken", jsontoken['apiToken']);
})
about 4 years ago · Santiago Gelvez 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!