Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Promise from 'bluebird';
- const ntlm = Promise.promisifyAll(require('request-ntlm-continued'));
- class httpNtlm {
- constructor() {
- this.ntlm = ntlm;
- this.username = config.username;
- this.password = config.password;
- }
- get(url, callback) {
- this.ntlm.get({url: url, username: this.username, password: this.password}, undefined)
- .then(body => {
- callback(JSON.parse(body));
- })
- .catch(err => {
- callback(JSON.parse(err));
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement