我尝试将表单从hist(a, breaks=c(0, 1, 2, max(a)), right=FALSE, include.lowest=TRUE)
发布到example.com
但我收到错误。
对预检请求的响应没有通过访问控制检查:否'访问控制 - 允许 - 来源'标头出现在请求的资源上。起源' http://hablow.net'因此不允许访问。响应的HTTP状态代码为403。
我已经从here
安装了Laravel Cors软件包api.example.com
我已尝试在PHP中手动添加标题...
<?php
return [
/*
|--------------------------------------------------------------------------
| Laravel CORS
|--------------------------------------------------------------------------
|
| allowedOrigins, allowedHeaders and allowedMethods can be set to array('*')
| to accept any value.
|
*/
'supportsCredentials' => false,
'allowedOrigins' => ['*'],
'allowedHeaders' => ['Origin', 'Content-Type', 'X-Requested-With'],
'allowedMethods' => ['*'], // ex: ['GET', 'POST', 'PUT', 'DELETE']
'exposedHeaders' => [],
'maxAge' => 0,
];
我尝试过什么似乎都失败了?继承我的AJAX
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, POST, PATCH, PUT, DELETE, OPTIONS');
header('Access-Control-Allow-Headers: Origin, Content-Type, X-Auth-Token');
答案 0 :(得分:0)