Answer the question
In order to leave comments, you need to log in
Passing parameters in get request in vue js?
I actually do the filtering, when you click on apply the filter, the request flies to the API
php developer, says that the request should be get, not post
How to pass parameters to the get request?
export const filterDate = (options) => {
console.log(options)
return axios.post(url, options).then(({ data }) => {
if (data.errors) throw new Error(JSON.stringify(data.errors));
return data;
})
};
Answer the question
In order to leave comments, you need to log in
https://github.com/axios/axios CTRL + F "get"
// Make a request for a user with a given ID
axios.get('/user?ID=12345')
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});
axios.get('/user', {
params: {
ID: 12345
}
})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question