Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49120

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at

$
0
0

@hitubansal wrote:

Hello
I am getting error

"NetworkError: 400 Bad Request - http://myapi/accounts/login"
login

Cross-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

Read full topic


Viewing all articles
Browse latest Browse all 49120

Trending Articles