首页 > 其他分享 >$.ajax与axios请求接口写法不同

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

时间:2025-02-07 16:11:45浏览次数:2  
标签:axios false xxx json ajax result 写法

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: () => {
                        
                    }
                });

 

标签:axios,false,xxx,json,ajax,result,写法
From: https://www.cnblogs.com/prince11/p/18702771

相关文章