$.ajax与axios请求接口写法不同

axios
axios({
        url: "xxx",
        data: JSON.stringify({
          a: "001",
          b: "xxx",
        }),
        async: false,
        cache: false,
        method: "POST",
        contentType: "application/json",
        dataType: "json",
        success: (result) => {
         
        },
        error: () => {
         
        },
      });

 


$.ajax
$.ajax({
                    url: 'xxx',
                    data: JSON.stringify({
                        a: '001',
                        b: "xxx"
                    }),
                    async: false,
                    cache: false,
                    type: 'POST',
                    contentType: 'application/json',
                    dataType: 'json',
                    success: (result) => {
                       
                    },
                    error: () => {
                        
                    }
                });

 

posted @ 2025-02-07 16:00  熬夜的布偶猫#  阅读(4)  评论(0)    收藏  举报