I'm very new to coding, I'm hoping someone can help me. I have this little bit of code, I am trying to learn this process:
- Call Made to URL via GET request (json)
- Parse the response from the GET request
- Save the response into a variable that I will use later
Any and all help is appreciated!
const XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;
const awsURL = 'https://cors.io/?http://status.aws.amazon.com/data.json';
function Get(awsURL){
var request = new XMLHttpRequest();
request.open("GET", awsURL, false);
request.send(null);
return request.responseText;
}
var AWSJson = JSON.parse(Get(awsURL));
console.log("Archived Outages: "+AWSJson.service_name);