Last active
September 24, 2019 17:10
-
-
Save brunopulis/709614a80784e7fdb8b3b505239f0514 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const URL = "http://swapi.co/api/people/1" // Retorna Luke Skywalker | |
fetch(URL) | |
.then(function(res){ | |
res.json().then(function(data){ | |
console.log(data); | |
}); | |
}) | |
.catch(function(err){ | |
console.error('Não foi possível achar a informação', err); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment