Hi all,
This where i am calling http call
angular
.module('myapp')
.factory('userFactory',function($http){
var factory = {};
factory.login = function(){
var data = {
userId:"test1",password:"test"
}
console.log(ddata.email)
return $http({
method : 'POST',
url : '
http://ec2-54-200-20-163.us-west2.compute.amazonaws.com:8080/e4c-V1/user/login
',
data : data,
headers : { 'Content-Type': 'application/json;charset=utf-8' }
});
}
return factory;
}
This is my config file
app.config(['$httpProvider', function ($httpProvider) {
// Reset headers to avoid OPTIONS request:
$httpProvider.defaults.headers.common = {};
$httpProvider.defaults.headers.post = {};
$httpProvider.defaults.headers.put = {};
$httpProvider.defaults.headers.patch = {};
$httpProvider.defaults.withCredentials = true;
$httpProvider.defaults.useXDomain = true;
delete $httpProvider.defaults.headers.common['X-Requested-With'];
}]);
This is the error which i am getting in console
OPTIONS
http://ec2-54-200-20-163.us-west2.compute.amazonaws.com:8080/e4c-V1/user/login
XMLHttpRequest cannot load
http://ec2-54-200-20-163.us-west-2.compute.amazonaws.com:8080/e4c-V1/user/login.
Response to preflight request doesn't pass access control check: A wildcard
'*' cannot be used in the 'Access-Control-Allow-Origin' header when the
credentials flag is true. Origin 'http://localhost' is therefore not
allowed access. The credentials mode of an XMLHttpRequest is controlled by
the withCredentials attribute.
what configuration has to be done to resolve this issue?
Thanks and Regards,
*Kiran A*
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.