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]}));

  

 
原文地址:https://www.cnblogs.com/chillaxyw/p/13411797.html