这是我代码的基础
const params = {
contractId: data.contractId,
notificationEmail: data.notificationEmail,
userNumber: data.userNumber
}
axios.put(update_user_url, params, {
headers: {
Authorization: `Bearer ${authToken}`
}
}).then(blablabla....)
但是,Axios在正文中发送contractId,email和User字段,而不是作为查询字符串。如何使其发送查询字符串?
答案 0 :(得分:1)
axios.put(
`${base_url}/user`,
null,
{
params: params,
headers: {
Authorization: token
}
}
);