Defines the interceptor for a Request. This allows you to intercept requests before starting.
Request
Adds a custom header to a request:
const addCustomHeaderInterceptor ({ key, value }: { key: string; value: string }): RequestInterceptor => ({ request }) => { const clone = request.clone() clone.headers.set(key, value) return clone} Copy
const addCustomHeaderInterceptor ({ key, value }: { key: string; value: string }): RequestInterceptor => ({ request }) => { const clone = request.clone() clone.headers.set(key, value) return clone}
Defines the interceptor for a
Request
. This allows you to intercept requests before starting.Example
Adds a custom header to a request: