Ignore 302 Redirect using aurelia-http-client


Using the aurelia-http-client, when I receive a 302 redirect from the server, the http client follows the redirect and responds with whatever the result of the redirect was.

I want to avoid this behaviour and deal with the 302 in my code. Is this possible?

I already have interceptors for other status codes but I don’t get to see the 302 because the http client has already dealt with it under the covers and all I get to see is the result after the redirect.

Thanks in advance.


If you use the fetch client instead of the http client, then you can use the redirect: error and then handle the error as you like.