var url = 'https://myurl.com/file.json';
request(url, function (error, response, body) {
if (!error && response.statusCode == 200) {
var jsonObject = JSON.parse(body);
console.log(jsonObject);
}
});
I've found the way to get JSON file from URL but it's a little bit struggle for me to assign it to a global variable. In this case, how can I deal with the jsonObject
?
via D. Matthew
No comments:
Post a Comment