ajax请求后台传body格式数据,服务器@RequestBody需要注意实相符

后台参数是body传参的,ajax的请求必须以下面的方式请求,不然会报500错误

$.ajax({
          type: "post",
          contentType:"application/json",
          dataType: 'json',
              data:JSON.stringify({"url":window.location.href,appId:"1000004"}),
          url: "http://192.168.104.155:8001/weixin/cuxJsAuth/config",
          success: function(data) {
            console.log(data)
          }
});    

 

posted @ 2022-05-12 16:58  秃头的铲屎官  Views(2364)  Comments(0Edit  收藏  举报