ajax 发送 json 数组

 
                    $.ajax({
                        url:url,
                        type:"POST",
                        
                        data:JSON.stringify(data),
                        dataType:"json",
                        contentType:"application/json",

                        
                        success:function(res){

                        }
                    })

        var xhr = new XMLHttpRequest();
        
        xhr.open("POST","www.baidu.com");
        xhr.setRequestHeader("Content-Type", "application/json")
        xhr.send(JSON.stringify({a:1,data:[1,2,3]}));

  

 
posted @ 2020-07-31 19:39  菜鸟木易  阅读(800)  评论(0编辑  收藏  举报