I have this code
var body="ok";
var suc=0; var failed=0;
$http({
url: API.toUrl('api/xxxx/xxxx'),
method: 'POST',
data: body
}).then(function(response) {
if(response.status==200){
suc=suc+1;
}
if(response.status==400){
failed=failed+1;
}
});
My problem in this is that I can't obtain the 400 Status Code, I am only getting 200 but not 400. How can I get 400 status code in my response
parameter.
I am working in Angular, any idea for obtain the 400?
Thanks