Offline HTTP Get request

Hi,

I am currently loading a list of people randomly taken from the randomuser.me api.
When I turn my internet connection off, I’m simply getting a net::ERR_INTERNET_DISCONNECTED error.
In a “no internet” case I would like to somehow save the http get request and when the connection turns on again, automatically call the saved request. Is that possible ?
Hope I’m clear enough.

Thanks

Right now i’m just saving the variables needed for the request in my local db, which is not quite what i’m trying to achieve.
Anything on this ?

You can simulate desired behavior with local db or, maybe, you can use angular cache https://github.com/jmdobry/angular-cache
You only need to make the new request when app return online.

Are you able to intercept those types of errors as ERR_INTERNET_DISCONNECT or CONNECTION_REFUSED?

We try to intercept those types of errors to handle appropriate errors. the http response is an empty response so we can not check it there. (status = 0 and statusText = “”", same error as on many other errors)