how do i make http post in nodejs without third party

const http = require('http');

const postData = 'your_data_here';

const options = {
  hostname: 'your_target_host',
  port: your_target_port,
  path: 'your_target_path',
  method: 'POST',
  headers: {
    'Content-Type': 'application/x-www-form-urlencoded',
    'Content-Length': Buffer.byteLength(postData)
  }
};

const req = http.request(options, (res) => {
  let data = '';

  // A chunk of data has been received.
  res.on('data', (chunk) => {
    data += chunk;
  });

  // The whole response has been received.
  res.on('end', () => {
    console.log(data);
  });
});

// Handle errors.
req.on('error', (e) => {
  console.error(`Problem with request: ${e.message}`);
});

// Write data to request body.
req.write(postData);

// End the request.
req.end();