chenge-0401

The server refused this request because the request entity is in a format not supported by the requested resource for the requested method

 

原因是传入json,未指定contentType : \'application/json\',

 

解决:ajax方法中加入 contentType : \'application/json\',

$.ajax({
            type:"post",
            url:"/addStudent",
            contentType : \'application/json\',
            data:data,
            success:function(result) {
                alert(JSON.stringify(result));
            },
            error:function() {
                alert("error");
            }
            
        });

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-11-20
  • 2021-11-20
  • 2022-12-23
  • 2021-11-20
  • 2022-02-11
猜你喜欢
  • 2021-11-20
  • 2021-11-20
  • 2021-11-11
  • 2021-11-20
  • 2021-11-20
  • 2021-11-20
相关资源
相似解决方案