柚子快报激活码怎么看778899分享:php 跨域请求解决的核心 - header(“Access-Control-Allow-Credentials:true”)
柚子快报激活码怎么看778899分享:php 跨域请求解决的核心
跨域请求后端解决方式
1.每个请必须都带有以下头,而非只有option请求才带
header(“Access-Control-Allow-Headers:x-requested-with,content-type,token”); header(“Access-Control-Allow-Credentials:true”); header(“Access-Control-Allow-Methods:POST,GET”); header(“Content-Type:text/html;charset=utf-8”); header(‘Access-Control-Allow-Origin:http://localhost:8080’);
2.如果是option请求需要
返回200状态码,比如php里面可以直接exit即可
柚子快报激活码怎么看778899分享:php 跨域请求解决的核心 拼多多帮助力入口
好文链接