SamDecrock / node-http-ntlm

Node.js module to authenticate using HTTP NTLM
MIT License
192 stars 89 forks source link

Pass custom headers to ntlm requests #69

Closed pettersamuelsen closed 1 year ago

pettersamuelsen commented 7 years ago

I had to send some custom headers with my ntlm requests so now you can do the following:

httpntlm.get({
  url: ``,
  username: '',
  password: '',
  workstation: '',
  domain: '',
  ntlmHeaders: {
    'X-Custom-Header': 'value',
  },
});
SamDecrock commented 6 years ago

You can just pass in extra headers using the regular options object:

httpntlm.get({
    url: "https://someurl.com",
    username: 'm$',
    password: 'stinks',
    workstation: 'choose.something',
    domain: '',
    headers: {
        'X-Custom-Header': 'value',
    }
}, function (err, res){
    if(err) return err;

    console.log(res.headers);
    console.log(res.body);
});