Tuesday, 25 April 2017

node js headers are stripepd from request

We are using request module, the url we are making the request to is aliased in the hosts file, but it appears so that the recipient receives the request with empty headers. If the request is sent to a url which doesn't require aliasing the headers arrive as expected. Any ideas why the headers can be stripped?

const options = {
  url,
  headers,
  body,
  rejectUnauthorized: false
};

request.post(options, function(err, res, body) {
  if (err) {
    console.log(err)
    return;
  }
  console.log(body)
  return;
});



via mr. Holiday

No comments:

Post a Comment