The 'Access-Control-Allow-Origin' header has a value 'https://dev.getevents.co' that is not equal to the supplied origin

佐手、 提交于 2021-01-28 04:59:32

问题


I developing a web app using to AngularJs and REST API. The REST APIs are hosted on some different servers.When I calling to this REST APIs, I have this problem called CROS:

XMLHttpRequest cannot load https://api.getevents.co/event?&lat=41.904196&lng=12.465974. The 'Access-Control-Allow-Origin' header has a value 'https://dev.getevents.co' that is not equal to the supplied origin. Origin 'http://localhost:8383' is therefore not allowed access.

My code is this:

modulo.controller('listaController', function ($scope, $http) {  
    $http.get('https://api.getevents.co/event?&lat=41.904196&lng=12.465974').success(function(data) {
        $scope.names = data;

    });
});*/

How can i resolve this problem

来源:https://stackoverflow.com/questions/29541216/the-access-control-allow-origin-header-has-a-value-https-dev-getevents-co

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!