本文已参与「新人创作礼」活动, 一起开启掘金创作之路。
遇到的跨域问题整理,都是在php文件里面添加的
附上参考链接
解决:Request header field Content-Type is not allowed by Access-Control-Allow-Headers - 程序员大本营
1.
Response to preflight request doesn't pass access control check: It does not have HTTP ok status.
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization");
header('Access-Control-Allow-Methods: GET, POST, PUT,DELETE,OPTIONS,PATCH');
2
Request header field content-type is not allowed by Access-Control-Allow-Headers in preflight response.
header("Access-Control-Allow-Origin: *");
\