Friday, April 12, 2019

Code Snippet : Windows NTLM POST using Node JS

let ntlm = require('request-ntlm-lite');

let postData = 'user=test';   //anything

let headers = {'Content-Type': 'application/x-www-form-urlencoded'};

let ntlmOptions = {                 
url: 'postUrl',
username: 'username',
password: 'password',
workstation:'',
rejectUnauthorized: false, //disable ssl certificate error
ntlm_domain: 'domain_name',
json: true,
headers:headers
};


ntlm.post(ntlmOptions, postData, function(error, response, body){
console.log(error);
console.log(response);                     
});

NodeJS

0 comments :

Post a Comment

 

© 2011 GIS and Remote Sensing Tools, Tips and more .. ToS | Privacy Policy | Sitemap

About Me