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

421
Vistas
POST Request does not show any value in node JS

I'm trying to send a post request to my node js server through google app script, but the received data is {}.

I tried sending a Post through zapier and postman, zapier will work if I set the payload type to "form" and postman will work if I set the body as x-www-form-urlencoded.

Any idea to make it work on google app script ?

enter image description here

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

Have you loaded json and urlencoded in your node server?

app.use(express.json());
app.use(express.urlencoded({ extended: true }));
over 4 years ago · Santiago Trujillo Denunciar

0

In your script, how about the following modification?

From:

var requestOptions = {
  "method" : "post",
  "contentType" : "application/x-www-form-urlencoded",
  "body" : payload
  //"body" : payload,

}

To:

var requestOptions = {
  "method": "post",
  "payload": payload
};
  • Property of body is not existing in UrlFetchApp.
  • application/x-www-form-urlencoded is the default content type.
  • When the request of this modification is run, payload is requested as the form data.

Note:

  • As the additional information, in your server-side of Node.js, if app.use(bodyParser.json()); is used, it is required to request as application/json as follows. Please be careful about this.

      var requestOptions = {
        "method": "post",
        "payload": JSON.stringify(payload),
        "contentType": "application/json"
      };
    

Reference:

  • fetch(url, params)
over 4 years ago · Santiago Trujillo 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