mirror of
https://github.com/jprdonnelly/qseow-scripts.git
synced 2025-12-19 17:17:04 -05:00
33 lines
898 B
JavaScript
33 lines
898 B
JavaScript
// const https = require('https');
|
|
const { http, https } = require('follow-redirects');
|
|
|
|
const fs = require('fs');
|
|
|
|
const options = {
|
|
hostname: 'central.browntown.local',
|
|
port: 4242,
|
|
path: '/qrs/about?xrfkey=abcdefghijklmnop',
|
|
method: 'GET',
|
|
// agent: 'Windows',
|
|
// login: 'INTERNAL\SA_API',
|
|
password: '',
|
|
headers: {
|
|
'X-Qlik-Xrfkey' : 'abcdefghijklmnop',
|
|
'X-Qlik-User' : `UserDirectory=${encodeURIComponent('INTERNAL')}; UserId=${encodeURIComponent('sa_api')}`
|
|
},
|
|
key: fs.readFileSync("client_key.pem"),
|
|
cert: fs.readFileSync("client.pem"),
|
|
ca: fs.readFileSync("root.pem"),
|
|
rejectUnauthorized: false
|
|
};
|
|
|
|
https.get(options, function(res) {
|
|
console.log("Got response: " + res.statusCode);
|
|
res.on("data", function(chunk) {
|
|
console.log("BODY: " + chunk);
|
|
});
|
|
}).on('error', function(e) {
|
|
console.log("Got error: " + e.message);
|
|
});
|
|
|