【发布时间】:2025-12-30 23:35:14
【问题描述】:
我有 axios 的表单提交功能:
const onSub mit = (data) => {
const webhookUrl = 'MY URL';
const info = JSON.stringify(data);
axios({
method: 'post',
url: `${webhookUrl}`,
data: info,
config: { headers: { 'Content-Type': 'application/json' } },
})
.then(function (response) {
alert('Message Sent!');
})
.catch(function (response) {
//handle error
console.log(response);
});
};
这是我在JSON.stringify 内部info 之后得到的:
{"fullname":"Temirlan","email":"test@mail.com","phone":"0179890808","proffesion":false,"message":"test"}
这是我在提交表单后在我的 webhook 中得到的,这是错误的:
我做错了什么?
【问题讨论】:
标签: javascript json reactjs axios webhooks