I am trying to get data from an api (api.keepa.com, just to test) in my firebase cloud function. Therefore, I have this code:
var url = "https://api.keepa.com"
var request = require('request');
console.log(url)
request(url, function (error1, response1, body1) {
if (!error1 && response1.statusCode == 200) {
console.log(body1)
}
else{
console.log("Error:",error1)
}
});
When I check it in the browser, I get a normal result ("Interested in our data? Check out our API: https://keepa.com/#!api").
When I run it in firebase cloud function or in repl.it, I just get "�����+I-J-.IMQ��S�/-RHI,I�Wp�HM��K�b��V%%�V��٩��z����ʊ��\&���H".
Is there anything I am doing wrong? Looks like a encoding issue for me.