$.ajax({
url: "/meeting/meet/createMeeting",
type: "POST",
contentType: "application/json; charset=utf-8",
dataType: 'json',
data: json,
success: function(data) {
console.log(JSON.stringify(data));
},
error: function(data) {
console.log(JSON.stringify(data));
}
});
该接口需要上传一个JSON格式的数据,后来发现是dataType:'json'导致的。
因为是测试阶段,后台随便返回了一个字符串,ajax检测返回的数据不是json,于是就会运行error。