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

161
Vistas
Google Cloud Function not receiving input from client

I have incoming data to my Google Cloud Function and for some reason, my Google Cloud Function is getting the input from the client side in an incorrect format and is causing it to pass an undefined value to a web scraper I am attempting to build. I have tried passing the data as input = JSON.parse(req.body.input) and destructing it from the req.body and then parsing it and that did not work either. Attached here is the Google Cloud Function code as well as my client-side request (I think the client-side is OK, but I am a newbie so I could be completely off. The URL being passed into the fetch isn't the real URL, not posting it because I don't want that URL out in the open.) Any help for this struggling junior would be super appreciated!

Google Cloud Function

 * Responds to any HTTP request.
 *
 * @param {!express:Request} req HTTP request context.
 * @param {!express:Response} res HTTP response context.
 */
const puppeteer = require("puppeteer");

exports.webScrape = async (req, resp) => {
    resp.header('Access-Control-Allow-Origin', '*')
    console.log('working woot woot')
    console.log(req.body)
resp.send('hello world')
};

Client-side request

      try {
        this.$emit("loading", true);
        console.log("getting the scraper");
        console.log(`here is input ${input}`);
        //" "" "
        const response = await fetch(
          "myURL",
          {
            method: "POST",
            mode: "cors",
            headers: {
              "Content-Type": "application/json",
              "Allow-control-allow-origin": "*",
            },
            body: JSON.stringify({ input }),
          }```
about 4 years ago · Juan Pablo Isaza
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