axios.get('/api/user', {
params: {
id: 123,
role: 'admin'
}
})
.then(function (response) {
// Handle the response
console.log(response.data);
})
.catch(function (error) {
// Handle any errors
console.error(error);
});