2

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

Alessandro
  • 905
  • 3
  • 17
  • 32
  • You'll have to get the people who control `api.getevents.co` to change their CORS configuration, or else you'll have to create your own proxy. – Pointy Apr 09 '15 at 14:25
  • You would need to change your domain from localhost to api.getevents.co and serve it over https. Port will also need to be 443. – Kevin B Apr 09 '15 at 14:34
  • who owns this server 'https://api.getevents.co/`? is it yours? if not then the owner does not want to allow any other host to connect to their api server, hence you cant do much about it.. – harishr Apr 09 '15 at 15:42

0 Answers0