When I try to post data from AngularJS, I am getting the below error.
XMLHttpRequest cannot load https://localhost:8089/services/auth/login. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access.
Here is the angularjs code
var app = angular.module('myApp', []);
sessionkey='';
var req = {
method: 'POST',
url: 'https://localhost:8089/services/auth/login',
headers : {
'Content-Type':'application/x-www-form-urlencoded',
'Accept':'*/*'
},
data : {
username : 'admin',
password : 'admin',
output_mode : 'json'
}
};
app.controller('myController', function($scope, $http) {
$http(req).success(function($scope, $http){
sessionKey= retrieveSessionKey($scope, $http);
});
});
How can I get around the issue?
Appreciate any input!