I'm currently using the node.js (Alexa SDK) and I'm having trouble sending a get request. Here's what my request looks like:
http.get("http://graph.facebook.com/v2.7", function(res) {
res.on('data', function (chunk) {
temp += chunk;
});
res.on('end', function () {
//Figure out how to not use "this" keyword because it doesn't work....
this.emit(":ask", toAsk, temp);
});
}).on('error', function (e) {
console.log("Got error: ", e);
});
As you can see, in the "end" callback I can't use the standard "this.emit" because "this" refers to something else in that context. I'm a bit confused on how to get around this. Could someone help?
Thank you