Last active
April 15, 2016 20:44
-
-
Save mindspank/9c1765180e8efe59ccbe to your computer and use it in GitHub Desktop.
Update dataconnection #qrs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var https = require('https'); | |
var fs = require('fs'); | |
var options = { | |
rejectUnauthorized: false, | |
hostname: <QRS HOST NAME>, | |
port: 4242, | |
path: '/qrs/dataconnection/18a67b3a-2228-4c06-9e38-c9cb9900288c?xrfkey=abcdefghijklmnop', | |
method: 'PUT', | |
headers: { | |
'x-qlik-xrfkey': 'abcdefghijklmnop', | |
'X-Qlik-User': 'UserDirectory= Internal; UserId= sa_repository ', | |
'Content-Type': 'application/json' | |
}, | |
key: fs.readFileSync(<YOUR CERTS>), | |
cert: fs.readFileSync(<YOUR CERTS>) | |
}; | |
var data = JSON.stringify({ | |
"name": "Google", | |
"connectionstring": "http://www.bing.com", | |
"type": "internet", | |
"id": "18a67b3a-2228-4c06-9e38-c9cb9900288c", | |
"modifiedDate": "2014-10-03T15:57:58.002Z" | |
}); | |
var post_req = https.request(options, function(res) { | |
res.setEncoding('utf8'); | |
res.on('data', function (chunk) { | |
console.log('Response: ' + chunk); | |
}); | |
}); | |
post_req.write(data); | |
post_req.end(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment