Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

184
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!