ajax
var arr=[1,2,3];
var arrstr = JSON.stringify(arr);//转化为json
$.ajax({
url: "send/array.html",
type: "post",
data:arrstr,//发送参数
contentType: "application/json;charset=UTF-8",//参数类型为json
dataType: "text",//如何对待服务器返回的参数
success: function (response) {
console.log(response);
},
error: function (response) {
console.log(response);
}
})
controller写法处理json参数请求