@hitubansal wrote:
Hello
I am getting error"NetworkError: 400 Bad Request - http://myapi/accounts/login"
loginCross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://api.datadudu.com/accounts/login. (Reason: CORS header 'Access-Control-Allow-Origin' does not match '*').
$http({
url: "http://api.datadudu.com/accounts/login",
data: { username: loginData.username, password: loginData.password },
headers: {
Accept: "/",
},
method: 'POST',
withCredentials: true,
}).success(function (data,textStatus,jqXHR) {
if (data.message == "success") {
deferred.resolve(data);
}
else {
deferred.resolve(0);
}
}).error(function (err) {
deferred.resolve(0);
})
return deferred.promise;
}Anybody help me out
Posts: 1
Participants: 1