一、415錯誤
將ajax的contentType屬性設置為"application/json;charset=UTF-8",如下所示:
$.ajax({ url: securedroot + "linkage/log/deleteTodaySchedule", type: "POST", dataType: "json", contentType: "application/json;charset=UTF-8", data: JSON.stringify(object), success: function () { }, error: function () { } });
二、400錯誤
前后台的數據是以字符串的形式傳輸的,將json格式的js對象轉成json格式的字符串傳輸,如下所示:
$.ajax({ url: securedroot + "linkage/log/deleteTodaySchedule", type: "POST", dataType: "json", contentType: "application/json;charset=UTF-8", data: JSON.stringify(object), success: function () { }, error: function () { } });
