Skip to content

Instantly share code, notes, and snippets.

@mindspank
Last active April 15, 2016 20:44
Show Gist options
  • Save mindspank/9c1765180e8efe59ccbe to your computer and use it in GitHub Desktop.
Save mindspank/9c1765180e8efe59ccbe to your computer and use it in GitHub Desktop.
Update dataconnection #qrs
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