axios.create() can't not handle params
See original GitHub issueDescribe the bug I created a instance with a param in it, but it doesn’t seem to work
I Have already decleared a instance axios in my js file
const instance = axios.create({
baseURL: '/',
params: {
secret: 123
}
})
I want to send a request like this /api/logout.json?secret=123
instance.get('/api/logout.json)
.then((res) => {
dispatch(changeLogin(false))
})
but after I use this instance to send a request the request is only /api/logout.json
What is this problem, did instance doesn’t received params?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:9
- Comments:13
Top Results From Across the Web
Default query params not getting passed in axios request
I'm using axios.create() to pass in a baseURL and some default query params like this axios.create({ baseURL: 'http://somebigurlhere', ...
Read more >Understanding Axios.create - LogRocket Blog
Learn why and how to effectively use Axios.create in your next project with this in-depth tutorial and example build.
Read more >Complete Guide to Axios HTTP Client - Reflectoring
Here we are using the async/await syntax to make a POST request with the axios.post() method. We are passing the new product to...
Read more >How to Perform HTTP Requests with Axios – A Complete Guide
Let's look at how we can deal with an Axios POST request's response. ... The axios.get() method is used to make an HTTP...
Read more >Making HTTP requests with Axios - CircleCI
This code snippet sends a GET request to the JSON API. Because the request returns a promise, you will use the .then() block...
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
Actually this is already a duplicate and is addressed in #2190 and #2196, so cancel that.
@Zu3zz I believe this should not be closed until a PR with the fix is created and merged to avoid duplicate issues. As been already said, this is a regression bug, and you don’t have to stop using params in instance, rather don’t use
0.19
until that. 😃