Skip to content

Instantly share code, notes, and snippets.

@sabljakovich
Last active May 12, 2022 11:32
Show Gist options
  • Save sabljakovich/d6a0369af750ecf96b76ce56f5474908 to your computer and use it in GitHub Desktop.
Save sabljakovich/d6a0369af750ecf96b76ce56f5474908 to your computer and use it in GitHub Desktop.
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