ajax上传数组

在ajax属性中加上traditional并设置为true即可


      
        var TOOLS = [1,2];
        $.ajax({
            url:getHostUrl() + "/application/findListByCategoryId.html",
            type:"GET",
            data:{"categoryId":TOOLS},
            async:true,
            traditional:true,
            success:function(res){
                console.log(res);
            }
        });

你可能感兴趣的:(ajax上传数组)