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

186
Vistas
Get the data of a PUT request NodeJS http

I am trying to get the data of a PUT request from a http server. I've tried the following:

const http = require('http');

const server = http.createServer(async (req, res) => {
    const body = await new Promise(resolve => {
       const data = [];

       req.on('data', chunk => {
           data.push(chunk);
       });

       req.on('end', () => {
           resolve(data.join(''));
       });
   });

   console.log(body);
});

server.listen(80);

But when I make a PUT request to this server with the name 'Test' and the value 'Test' I get the following response:

------WebKitFormBoundary5irMnjtb69WOI025
Content-Disposition: form-data; name="Test"

Test
------WebKitFormBoundary5irMnjtb69WOI025--

How do I make a JSON object of this?

about 4 years ago · Santiago Trujillo
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