Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

618
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda