I want to make some http requests and return always status 200, because if I return other status the browser console will log it, and I want to avoid that. I read about JSend, and I want to know if there is anyway to catch it response doing something like this:
this.http.post("/login", JSON.stringify(credentials))
.map(result => result.json())
.subscribe(
data =>this.router.navigate(["home"]),
() => this.router.navigate(["login"], {queryParams: {error: true}})
);
I want to avoid asking with ifs to know the backend response, if there is any other good way to do this is welcome too.