美文网首页
header设置跨域问题

header设置跨域问题

作者: Sugar_ping | 来源:发表于2016-06-14 17:39 被阅读0次

//    使用通配符 * ,表示当前服务端 返回的信息允许所有源访问,也可指定可信任的域名来接收响应信息        

header("Access-Control-Allow-Origin: http://localhost:3000");

header("Access-control-Allow-Origin:*");

//    响应头设置为ajax提交        

header("Access-Control-Allow-Headers:X-Requested-With");

//    允许携带 用户认证凭据(也就是允许客户端发送的请求携带Cookie)        

header("Access-Control-Allow-Credentials:true");

写到方法内部

相关文章

网友评论

      本文标题:header设置跨域问题

      本文链接:https://www.haomeiwen.com/subject/oeyudttx.html