How to log all axios calls from one place in code

前端 未结 6 1218
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-30 12:17

I am using axios for a react application and I would like to log all axios calls that I\'m making anywhere in the app. I\'m already using a single global instance of axios via t

6条回答
  •  庸人自扰
    2021-01-30 13:04

    It looks like you can intercept all requests using an "interceptor", and log inside of it: https://github.com/mzabriskie/axios#interceptors

提交回复
热议问题