JSON.stringify() 方法用于将 JavaScript 值转换为 JSON 字符串
var obj = {
name: 'mossbaoo',
age: '22'
}
$.ajax({
type : "post",
dataType : "json",
url: "http://xxx/xxx",
data : {
user:JSON.stringify(obj)
},
success : function(res) {
}
});
转换前:
转换后: