我已经按照教程中说明的 这个链接。在下面的代码中,由于某种原因,数据没有作为参数附加到 URL,但是如果我使用 /?field1="hello"
将它们直接设置为 URL,那么它就可以工作了。
$.ajax({
url: 'superman',
type: 'POST',
data: { field1: "hello", field2 : "hello2"} ,
contentType: 'application/json; charset=utf-8',
success: function (response) {
alert(response.status);
},
error: function () {
alert("error");
}
});