Skip to content

Instantly share code, notes, and snippets.

@allangrds
Created October 26, 2020 20:53
Show Gist options
  • Save allangrds/0986e6e59d15b0ff9dc78b18853abe3b to your computer and use it in GitHub Desktop.
Save allangrds/0986e6e59d15b0ff9dc78b18853abe3b to your computer and use it in GitHub Desktop.
axios.interceptors.request.use(config => {
// loga(log) uma mensagem antes da requisição HTTP ser enviada
console.log('A requisição foi enviada');
return config;
});
// faz uma requisição GET
axios.get('https://api.github.com/users/sideshowbarker')
.then(response => {
console.log(response.data);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment