Skip to content

Instantly share code, notes, and snippets.

@BrunoGiubilei
Last active September 24, 2021 10:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BrunoGiubilei/a6c604e8f29c90b2b3aa45d61364743b to your computer and use it in GitHub Desktop.
Save BrunoGiubilei/a6c604e8f29c90b2b3aa45d61364743b to your computer and use it in GitHub Desktop.
Fetch em javascript puro
fetch(url)
.then((resp) => resp.json())
.then(function(data) {
console.log(data);
});
// se por acaso o CORS reclama
fetch(url,{
mode: 'no-cors'
})
.then((resp) => resp.json())
.then(function(data) {
console.log(data);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment