Angular #56 - HTTP Interceptor | Clone (How we can modify each HTTP Request in Common Place)

preview_player
Показать описание

*Note : Switch the particular branch of the tutorials of Github*

*HTTP Interceptor*

With interception, you declare interceptors that inspect and transform HTTP requests from your application to a server. The same interceptors can also inspect and transform a server's responses on their way back to the application. Multiple interceptors form a forward-and-backward chain of request/response handlers.

Interceptors can perform a variety of implicit tasks, from authentication to logging, in a routine, standard way, for every HTTP request/response.
Without interception, developers would have to implement these tasks explicitly for each HttpClient method call.

The angular cli cmd to create interceptor : ng g interceptor interceptor-name
Рекомендации по теме