📌  相关文章
📜  原因:CORS 标头“Access-Control-Allow-Origin”缺失 - 无论代码示例

📅  最后修改于: 2022-03-11 14:57:19.880000             🧑  作者: Mango

代码示例5
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: POST, GET, PUT, PATCH, DELETE, OPTIONS');
header('Access-Control-Allow-Headers: *');
if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
    exit(0);
}