Ajax跨域请求PHP header设置

Ajax跨域请求PHP header设置,具体实例代码如下: header('Access-Control-Allow-Origin : *');header('Access-Control-Allow-Headers : Origin, X-Requested-With, Content-Type, Accept');header('Access-Control-Allow-Methods :PUT,POST,GET,DELETE,OPTIO
Ajax跨域请求PHP header设置,具体实例代码如下:
header('Access-Control-Allow-Origin : *');
header('Access-Control-Allow-Headers : Origin, X-Requested-With, Content-Type, Accept');
header('Access-Control-Allow-Methods :PUT,POST,GET,DELETE,OPTIONS');
//持久化session
header("Access-Control-Allow-Credentials : true");
//客户端:
    xhrFields: {
        withCredentials: true
    }
 
本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐