How can I return the value of a remote json and read it as a string, eg when I get json it prints the entire result as in the image below. codebelow:
varhttps=require('https');varoptionsget={host:'the-evie.com',port:443,path:'/playerscript/pc/Droust',method:'GET'};console.info('Optionsprepared:');console.info(optionsget);console.info('DotheGETcall');varreqGet=https.request(optionsget,function(res){console.log("statusCode: ", res.statusCode);
res.on('data', function(d) {
console.info('GET result:\n');
process.stdout.write(d);
console.info('\n\nCall completed');
});
});
reqGet.end();
reqGet.on('error', function(e) {
console.error(e);
});
What I wanted was to make it filtered such as username, was able to receive value by key, ie key username value Droust.