@mdline wrote:
Hello,
I make a request and want that only the nested requests are made when the first returns a http status code 303.
My backend returns 303 when session expired and I want that after successfull login the request for fetching person information is made again.
So is it possible to say that the nested request is only made when the request before has status code 303?getPersons() { return this.http.get(URL_PERSONS).map(res => { if (res.status === 303) { return res; } else { return res.json(); } }) .flatMap((res) => { if (res.status === 303) { return this.login(); }else { return res; } }).flatMap(res => { return this.http.get(URL_PERSONS); }); }
Posts: 1
Participants: 1