jQuery通过 AJAX 向后端发送 JSON 数据,必须设置 contentType 值为 application/json,并且调用 JSON.stringify() 方法
// 发送ajax请求
$.ajax({
type: "POST",
url: 'https://shuaiguoer.com/info',
dataType: "json",
contentType: 'application/json',
data: JSON.stringify({
User: currentUser,
password: password,
money: money
}),
success(res) {
console.log(res);
}
});
One comment
我试一试windows11