Skip to content

Instantly share code, notes, and snippets.

@jmlavoier
Created September 29, 2017 01:36
Show Gist options
  • Save jmlavoier/2cca87aab4ca37b6af2eac67832eaf38 to your computer and use it in GitHub Desktop.
Save jmlavoier/2cca87aab4ca37b6af2eac67832eaf38 to your computer and use it in GitHub Desktop.
const xhr = new XMLHttpRequest();
xhr.open('GET', 'https://swapi.co/api/people/');
xhr.responseType = 'json';
xhr.onload = function() { console.log(xhr.response); }; xhr.onerror = function() { console.log("Erro"); };
xhr.send();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment