我遵循了this链接中的教程.在下面的代码中,由于某种原因,数据不会作为参数附加到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");
}
});