Reputation: 61
This is the base of my code
const params = {
contractId: data.contractId,
notificationEmail: data.notificationEmail,
userNumber: data.userNumber
}
axios.put(update_user_url, params, {
headers: {
Authorization: `Bearer ${authToken}`
}
}).then(blablabla....)
However Axios sends the contractId, email and User fields in body, not as a Query string. How do I make it send a query string?
Upvotes: 1
Views: 3970
Reputation: 54
axios.put(
`${base_url}/user`,
null,
{
params: params,
headers: {
Authorization: token
}
}
);
Check the documentation.
Upvotes: 1