var realmStatus = "http://api.dol.gov/V1/Statistics/OES/OE_AREATYPE/?KEY=1ce7650d-b131-4fb7-91b3-b7761efc8cd4";
//"http://api.dol.gov/V1/WHPS/?KEY=1ce7650d-b131-4fb7-91b3-b7761efc8cd4";
//source: http://stackoverflow.com/questions/17811827/get-a-json-via-http-request-in-nodejs
var http = require("http");
var options = {
host: 'api.dol.gov',
path: realmStatus,
type: 'GET',
dataType: 'json',
headers: {'accept' : 'application/json'}
};
console.log("Start");
var x = http.request(options,function(res){
console.log("Connected");
res.on('data',function(data){
console.log(data.toString()+"\n");
});
});
x.end();
I have a bunch of json files that i grab from a site api tables which outputs different type of json data, and just want to know is there a way to store these files into variable or in an array.
MY partner said this , but don't know what he means and how to do it. I got filtering the data for each tables.
"So what we know now is that each requst will give us one table. What you need to do, is store those variables that are given to us from the JSON file by storing them in a variable or an array. When dealing with JSON, you an access parameters by using the reference to the JSON file, then using the . operator to access each variable inside of the JSON file. If you can just print those values stored in the JSON file, then this is pretty much a success with the user story. It means we can access those values and make cross comparisons with what the user has and the data given to us from the table."