Support for using custom instance of axios
See original GitHub issueWhen using the httpClient: 'axios'
option, I would like to be able to also use a custom axios instance for making the requests.
The reason for that is that I would like to use an Axios instance configured to my liking (custom interceptors, different timeout value, etc…).
Looking at the code it seems that it would be pretty easy to support that and I could contribute if the feature request is accepted.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:18
- Comments:9 (1 by maintainers)
Top Results From Across the Web
The Axios Instance | Axios Docs
The Axios Instance. Creating an instance. You can create a new instance of axios with a custom config. axios.create([config]).
Read more >How to Create a Custom Axios Instance? - RapidAPI
Axios allows us to create new instances with custom configuration. This guide will demonstrate how to create a custom instance with Axios.
Read more >Understanding Axios.create - LogRocket Blog
Axios.create is a handy feature within Axios used to create a new instance with a custom configuration. With Axios.create, we can generate a ......
Read more >Custom Axios Instance - use-axios-client
You can define a custom axios instance to be used for a request. This is useful if your app needs to interact with...
Read more >Complete Guide to Axios HTTP Client - Reflectoring
An Axios instance created with Axios.create() with a custom config helps us to reuse the provided configuration for all the API invocations made ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Having an option to use custom instances would be great. I actually have a problem where a can’t use interceptors nor set language headers in a nuxt app because the framework encapsulates the options from the composables.
Unless I’m doing something very wrong, I can’t have multiple configs working for all parts of my app without dropping this lib entirely
Makes sense to me as well. I think you also want the generated code to export the created axios instance so that your consumer code could set the default config for the instance via
myAxiosInstance.default
without messing with the generated code.