axios-module icon indicating copy to clipboard operation
axios-module copied to clipboard

[Question] Customize config options without your own instance

Open lennoximus opened this issue 3 years ago • 1 comments

Hello.

I've got a question. Am I somehow able to specify several config options (validateStatus, paramsSerializer and socketPath, to be correct) without creating my own axios instance as mentioned here? The point is If I'm extending axios with the described method, I'm no longer able to use built-in helpers such as onRequest, onError and so on, am I correct on this? I understand these helpers are just wrappers around native axios interceptors and I can just copy the module's source code to handle them, but it doesn't seem to be a good option. Could you explain this to me? Thanks in advance.

lennoximus avatar Feb 08 '21 12:02 lennoximus

Hi @lennoximus

When creating a new instance of axios following the documentation https://axios.nuxtjs.org/extend/#new-axios-instance You are able to use all the helpers described https://axios.nuxtjs.org/helpers

ricardogobbosouza avatar Feb 15 '21 14:02 ricardogobbosouza