Last active
May 12, 2022 11:32
-
-
Save sabljakovich/d6a0369af750ecf96b76ce56f5474908 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
const axios = require('axios').default; | |
axios.interceptors.request.use(x => { | |
// replace console with our logger of choice | |
console.log(x); | |
return x; | |
}) | |
axios.interceptors.response.use(x => { | |
console.log(x) | |
return x; | |
}) | |
axios.post('https://jsonplaceholder.typicode.com/posts', { | |
myProperty: true | |
}).then() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment