Skip to content

Instantly share code, notes, and snippets.

@evolkmann
Created April 25, 2018 05:38
Show Gist options
  • Save evolkmann/28e72447ed40aeecee5c09a513fc8b2c to your computer and use it in GitHub Desktop.
Save evolkmann/28e72447ed40aeecee5c09a513fc8b2c to your computer and use it in GitHub Desktop.
const performARequest = () => {
const httpRequest = new XMLHttpRequest();
httpRequest.onreadystatechange = () => {
if (httpRequest.readyState === 4 && httpRequest.status === 200) {
console.log('Request successful!');
}
};
httpRequest.open('GET', window.ENVIRONMENT.backendUrl + '/users/john');
httpRequest.send();
};
performARequest();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment