How to pass axios options per query
See original GitHub issueI haven’t found a possibility to add an options
parameter for each generated query. From my point of view it shoul looks like this:
const myApiCall = (queryParameter: string, options?: AxiosRequestConfig) => customAxiosInstance({ url: '/some_url', method: 'get', ...options })
There is a similar issue but I didn’t get why there should be an extra parameter in mutator. From docs:
The second argument is only provided for the Angular client and give an instance of HttpClient
Also I tried to use an undocumented parameter override.requestOptions
but had no luck 😦
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
How to post query parameters with Axios? - Stack Overflow
So I don't know how to pass Query Parameters with Axios in my request (because right now, it's passing data: { mail: "lol@lol.com", ......
Read more >GET Request Query Params with Axios - Mastering JS
The easiest way to make a GET request with Axios is the axios.get() function. The 2nd parameter to axios.get() is the Axios options:...
Read more >How to Perform HTTP Requests with Axios – A Complete Guide
Sending asynchronous HTTP queries to REST endpoints and performing CRUD operations is simple using Axios POST request and GET request.
Read more >Request Config | Axios Docs
These are the available config options for making requests. Only the url is required. Requests will default to GET if method is not...
Read more >Complete Guide to Axios HTTP Client - Reflectoring
Then we are passing a configuration argument to the axios instance ... Instead of appending the request query parameter in the URL in...
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 Free
Top 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
@yekver if you have the mutator warning that’s why it doesn’t work for you. Because orval cannot know that you have a second argument since it cannot parse it
Yeah, I think the solution is described clearly.