Created
October 26, 2020 20:53
-
-
Save allangrds/0986e6e59d15b0ff9dc78b18853abe3b to your computer and use it in GitHub Desktop.
This file contains 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
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