I'm running the following within node.js:
function makeGetFunction(url) {
url = url + '?' + authstring;
console.log("get " + url);
request.get(url, function(e, r, data) {
var json = JSON.parse(data);
var resp = json.entities;
});
}
I would like to have makeGetFunction() return resp. I think the the answer lies somewhere with using a callback, but as I'm fairly new to asynchronous calls in javascript, I'm stumbling with how to properly pull it off. I haven't been able to find any examples or posts related to my question yet. Please excuse the newbie question.