Skip to content Skip to sidebar Skip to footer

Cors Request Is Not Allowed With Angularjs

I'm trying to access an API from an Angular JS controller using the following code: $scope.getOperators = function() { $scope.CSVData.forEach(function(entry) { $http.de

Solution 1:

The server proivdes CORS support. You'll need to enable it there.

Access-Control-Allow-Headers: Content-TypeAccess-Control-Allow-Methods: GET, POST, OPTIONSAccess-Control-Allow-Origin: *

Ideally you'd replace the Access-Control-Allow-Origin to just domains that you want to allow or else anyone could access the api remotely / from their servers.

Post a Comment for "Cors Request Is Not Allowed With Angularjs"