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

68
Vistas
Javascript - Store the response of a POST request in a variable

I have been trying to store the result of a POST request into a variable. I am coding in Zapier

let numero= input_data["numero"]
let data = {element: numero, elemento: "www.link.it" }

fetch("url", {
  method: "POST",
  headers: {'Content-Type': 'application/json'}, 
  body: JSON.stringify(data)
})

.then(function(res) {
  return res.text();
})
.then(function(body) {
  console.log(body);
  var output = {rawHTML: body};
  callback(null, output);
})
.catch(callback);

Pretty new to this

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Not sure if this has much to do with Zapier. It is just orfdinary Javascript fetch api

But you could for example do something like this:

let responseBody;    
fetch("url", {
method: "POST",
headers: {'Content-Type': 'application/json'}, 
body: JSON.stringify(data)
})

.then(function(res) {
     responseBody = await res.text();
   })
  .then(function(body) {
        console.log(body);
        var output = {rawHTML: body};
        callback(null, output);
  })
    .catch(callback);
about 4 years ago · Juan Pablo Isaza 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