Interceptors Overview
Interceptors allow you to modify requests and responses, or handle errors globally. They are executed in the order they are added.
There are three types of interceptors:
- Pre-Interceptors: Modify requests before they’re sent
- Post-Interceptors: Modify responses after they’re received
- Error Interceptors: Handle errors globally
Interceptors are useful for:
- Adding custom headers to all requests
- Logging requests and responses
- Transforming data
- Centralized error handling
- …