Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 角度2';访问控制允许原点';请求API调用时出现问题_Angular_Http_Header_Request_Cross Domain - Fatal编程技术网

Angular 角度2';访问控制允许原点';请求API调用时出现问题

Angular 角度2';访问控制允许原点';请求API调用时出现问题,angular,http,header,request,cross-domain,Angular,Http,Header,Request,Cross Domain,嘿,当我从angular 2应用程序中访问API时,我遇到了这个问题 请求的资源上不存在“Access Control Allow Origin”标头 如何在get方法中发送头请求?您需要在服务器端实现CORS。这里已经提出了类似的问题:可能是重复的,但我有两个不同的api,具有不同的端点,其中一个工作正常,另一个返回cors错误

嘿,当我从angular 2应用程序中访问API时,我遇到了这个问题

请求的资源上不存在“Access Control Allow Origin”标头


如何在get方法中发送头请求?

您需要在服务器端实现CORS。这里已经提出了类似的问题:可能是重复的,但我有两个不同的api,具有不同的端点,其中一个工作正常,另一个返回cors错误