Hi
I want to get data from an external API, i would like to authenticate using a .pem or certificate with the meteor http package, is this possible?
In pure node code it looks like this, in the request at the end, they just put the settings object…
var settings = {
host: hostUri.hostname,
port: hostUri.port,
path: hostUri.pathname + '?' + ((hostUri.query) ? hostUri.query + '&' : '') + 'xrfkey=' + xrfkey,
method: method,
headers: {
'X-Qlik-Xrfkey': xrfkey,
'X-Qlik-User' : 'UserDirectory= WINDOWS2012; UserId= qlikservice ',
'Content-Type': 'application/json'
},
pfx: cert,
passphrase: options.PassPhrase,
rejectUnauthorized: false,
agent: false
};
//Send ticket request
var req = https.request(settings, function (res) {
Thank you
mjmasn
June 19, 2016, 2:34pm
2
You can indeed. It’s in the docs http://docs.meteor.com/api/http.html#HTTP-call
You want the npmRequestOptions
option, which is options to pass to the request library that Meteor HTTP uses in the background. See https://github.com/request/request#using-optionsagentoptions for the relevant options for authenticating with a certificate.
1 Like
Thank you so much!! …
Btw, you would really make my day if you also know the answer for my strange issue with the dropdown box.
Cool! that did the trick! thank you. The only thing still left is that if I restart the server, the values are not populated of the listbox (if I insert a new item in the customer collection, then the listbox works. Deleting an item does not force the update) my helper is Template.OEMPartner.helpers({ customers() { return Customers.find({}, { sort: { checked: -1 } }); },