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-Type
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-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"