Ajax请求参数传到后台为空

1、编码格式

$.ajax({
        method:'POST',
        url:'/midservice/studentAction/addStudent',
        data:$.toJSON(userDate),
        async:false,
        cache : false,
        dataType:"json",
        crossDomain : true, //跨域问题
        contentType: "application/json; charset=utf-8",//请求需要发送的处理数据  编码格式
        success:function(data){
            
        },
        error:function(){
           
        },
    });

猜你喜欢

转载自www.cnblogs.com/ssbydk/p/10256671.html