跨域请求问题在服务端设置了Access-Control-Allow-Origin后依然不能解决的问题

 如下:如果将ajax请求的请求头content-type设置成为"application/x-www-form-urlencoded",即便在服务端设置的跨域配置依然不能解决问题,(但是通过在浏览器插件中进行跨域却没有问题)去掉content-type 请求依然是form-data的方式提交

$.ajax({
    async: false,
    crossDomain:true,
    url: "http://" + host + "/jitGWAuth",
    method: "POST",
    dataType: "json",
    //headers: {
    // "content-type": "application/x-www-form-urlencoded",
    // "cache-control": "no-cache"
    //},
    data:{
        "authMode": "cert",
        "original": original,
        "signed_data": signResult
    },
    success:function(response){}
})

 


版权声明:本文为u011400289原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。