SamDecrock / node-http-ntlm

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

Add new "binary" option to support downloading binary files. #68

Closed ian-mcdowell closed 1 year ago

ian-mcdowell commented 7 years ago

The httpreq library will not properly download binary files without using the "binary" option. This change adds an option to httpntlm that gets passed through to httpreq. It's false by default.

I've verified that this works on my own installation, downloading an image from a server.

SamDecrock commented 6 years ago

You can just pass "binary" to the regular options object:

httpntlm.get({
    url: "https://someurl.com",
    username: 'm$',
    password: 'stinks',
    workstation: 'choose.something',
    domain: '',
    binary: true
}, function (err, res){
    if(err) return err;

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