Hello,
I am currently using the HTTP.call() method to call a webservice and process the response.
After doing the call, I am trying to use the response object to fill in (initialize) some variables, but it seems that doesn’t really happen.
Can anyone please explain how that happens and how I can make this work? Please see code below:
let testString;
HTTP.call('GET','http://localhost:8080/getinformation', {
params: {
"userid": user._id,
"locationid": locationid,
}
},function(error, response) {
if(error) {
console.log("Error -> " + error);
testString = error;
} else {
testString = response.statusCode;
}
});
console.log('TEST STRING -> ' + testString);
Calling Test string in the console log, returns an undefined.