【发布时间】:2021-09-05 02:43:51
【问题描述】:
我正在研究 Flutter,在我的 php API 中,我放置了这些标头:
header('Content-Type: application/json');
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET');
header("Access-Control-Allow-Headers: X-Requested-With");
但我仍然有答案:
“Access to XMLHttpRequest at 'http://localhost/spring_box/api.php' from origin 'http://localhost:52502' has been blocked by CORS policy: The 'Access-Control-Allow-Origin'”
你能帮我解决我的问题吗?
【问题讨论】: