I have made a http client using Node that sends a post request. However the service has NTLM authentication enabled. How do I add my username and password in the post request ?
var http=require('http')
var options = {
host: 'kmserver28',
port: 3535,
path: '/Alto/Post/PostFetchWS.asmx/FetchPosts',
method: 'POST'
};
var req = http.request(options, function(res){
console.log('status: ' + res.statusCode);
console.log('headers: ' + JSON.stringify(res.headers));
res.setEncoding('utf8');
res.on('data', function(chunk){
console.log("body: " + chunk);
});
});
req.on('error', function(e) {
console.log('problem with request: ' + e.message);
});
// write data to request body
req.write('data\n');
req.write('data\n');
req.end();