How Do You Write An Angular Interceptor?

How Do You Write An Angular Interceptor? To implement an interceptor, you’ll want to create a class that’s injectable and that implements HttpInterceptor. The intercept method takes two arguments, req and next, and returns an observable of type HttpEvent. req is the request object itself and is of type HTTP Request. What is the use