I have a function called login, when the User pushes the button, the code below will be executed.
So i try to see if the user exists and to get his data in an JSON Object but that doesn't work, i get following Message:
SyntaxError: Unexpected token s
at Object.parse (native)
the URL is exactly like i want it to be.
$scope.login = function() {
var request = $http({
method : "GET",
url : "/REST/user" + "/" + $scope.email + "/" + "password" + "/" + $scope.password,
headers : {
'Content-Type' : "application/json"
}
});
request.success(function(response) {
location.href = "../views/test.html"
});
request.error(function(response) {
growl.addErrorMessage("doesn't work", {
ttl : 4000
});
});
}
Output by Browser
{
"id": "9be1804a-e366-11e4-9d4b-82ea0d805d53",
"email": "[email protected]",
"facebook_id": null,
"firstname": "test",
"lastname": "blabla",
"password": null,
"gender": null,
"is_active": "0",
"birthday": null
}