$http service is extremely flexible and powerful. Its super-powers are result of clean, flexible API and usage of the Promise API. In this section, we are going to see how we can use some of the more advanced features of the
$http service allows us to register interceptors that will be executed around each and every request. Such interceptors are very useful in situations where we need to do special processing for many (potentially all) requests.
As the initial example, let's assume that we want to retry failed requests. To do so we can define an interceptor that inspects response status codes and retries a request, if the HTTP Service Unavailable (503) ...