From an angular app, when I send a post request using jQuery as follows, ...
this.login = function (email, password) {
return $.getJSON(FOO_URL, {
email: email,
password: password
});
}
... my response is perfectly fine.
Object {result: "ok", key_one: result_one, key_two: result_two, ...}
However, when I try to do the same thing using angular's $http
as follows, ...
this.login = function (email, password) {
return $http.post(FOO_URL, {
email: email,
password: password
});
}
... my response data is completely empty.
Object {data: "", status: 200, config: Object, statusText: "OK"}
Why is my response data empty with angular $http
?