ajax:
var json = {
UserName: "chog test",
UserPassword: "chog123321",
UserPhone: "110",
Address: {
Province:"省",
City:"城市",
County:"国家",
AddressDetails:"详细地址",
},
IsDeleted: true,
IsDisable: true,
CreateUserId: "e7bf9773-8231-44af-8d53-e624f0433940",
CreateUserName: "admin"
}
var data = JSON.stringify(json);
$.ajax({
type: 'POST',
url: 'https://localhost:5001/api/User/AddUserInfoM',
// url: 'https://localhost:5001/api/values/Test',
// dataType: 'json',
contentType: 'application/json',
data: data,
// data:JSON.stringify({a:'1',b:'2'}),
error: function (XMLHttpRequest) {
alert('post error!');
},
success: function (data) {
alert(data.message);
}
});
接收到的数据
上图为什么接收到的数据,外面是两个括号呢?