daihu

一、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 () {
                
            }
        });

 

分类:

技术点:

相关文章:

  • 2021-09-21
  • 2021-12-22
  • 2021-12-28
  • 2021-11-20
  • 2021-05-05
  • 2021-06-16
  • 2021-05-01
  • 2021-05-27
猜你喜欢
  • 2021-05-14
  • 2021-11-20
  • 2021-12-28
  • 2021-04-10
  • 2021-05-16
  • 2021-09-17
  • 2021-07-05
  • 2021-04-23
相关资源
相似解决方案