Skip to content

Instantly share code, notes, and snippets.

@jaydson
Created March 8, 2021 16:46
Show Gist options
  • Save jaydson/670bbdef52d887a576c84fb7c6caf82d to your computer and use it in GitHub Desktop.
Save jaydson/670bbdef52d887a576c84fb7c6caf82d to your computer and use it in GitHub Desktop.
const URL_TO_FETCH = 'https://braziljs.org/api/list/events';
fetch(URL_TO_FETCH, {
method: 'get' // opcional
})
.then(function(response) {
response.text()
.then(function(result) {
console.log(result);
})
})
.catch(function(err) {
console.error(err);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment