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

617
Views
Cartero: ¿dónde está el cuerpo en un pm.sendRequest()?

Estoy escribiendo un script de prerrequisito en Postman para obtener un token. La solicitud de publicación funciona bien desde la consola, pero no puedo encontrarla ni analizarla en el código.

 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*/ })

Básicamente, me gustaría capturar el cuerpo de la solicitud posterior. ¿Hay algún método? me estoy perdiendo algo? y gracias de antemano por el apoyo.

ENCUENTRA UNA SOLUCIÓN.

Didi analicé la respuesta.

básicamente:

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

Dejaré la solución, espero que sea útil para alguien más.

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

ENCUENTRA UNA SOLUCIÓN.

Didi analicé la respuesta.

básicamente:

 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!