1// NodeJS
2const http = require("http");
3var url = 'https://example.com/file.json'; // Request URL
4
5http.get(url, function(res){
6 var body = '';
7
8 res.on('data', function(chunk){
9 body += chunk;
10 });
11
12 res.on('end', function(){
13 var data = JSON.parse(body);
14 console.log("Got a response: ", data.value);
15 });
16}).on('error', function(e){
17 console.log("Got an error: ", e);
18});