I am having issues performing a simple GET call to microsoft's keys. This call works perfectly in postman but will not work in NodeJS.
Any ideas why?
const http = require('https');
var options = {
host: 'login.microsoftonline.com',
path: '/common/discovery/keys'
};
callback = function(response) {
var str = '';
//another chunk of data has been received, so append it to `str`
response.on('data', function (chunk) {
str += chunk;
});
//the whole response has been received, so we just print it out here
response.on('end', function () {
console.log(str);
});
}
http.request(options, callback).end();