angular-http-interceptors Questions
4
Solved
I have the below http interceptor in my angular application and I would like to unit test the same using Jasmine. I googled some of them and tried but its not working as expected. Please find the b...
Distant asked 8/9, 2021 at 9:51
3
Here is my interceptor using the new way of intercept of angular, using a function instead of a class
export const errorInterceptor: HttpInterceptorFn = (req, next) => {
console.log('Intercepte...
Aplanatic asked 18/1, 2024 at 17:15
3
Solved
I am missing http headers in a response from my HttpInterceptor. I can get a body but not headers. Please see attached output and my code.
@Injectable()
export class ApiVersionInterceptor implemen...
Musser asked 11/2, 2020 at 10:18
3
Solved
I'm trying to call a localhost API and to attach the bearer token on the header. It should be done by msal-angular automatically.
For now, I have added the localhost API route to the protectedResou...
Artemas asked 9/3, 2021 at 8:57
3
Solved
I'm trying to add an interceptor to standalone component by adding the interceptor to the providers array in the component itself ( { provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: t...
Photoelasticity asked 29/8, 2022 at 14:0
2
Solved
I was using the following class-based interceptor to refresh user token:
@Injectable()
export class AuthInterceptor implements HttpInterceptor {
constructor(private inject: Injector) {}
interce...
Kansu asked 18/1, 2024 at 16:33
2
Solved
I was wondering if there is a way to retrieve the current route in an HttpInterceptor in Angular. I am using the same interceptor from different routes, but I need to check if the interceptor is be...
Andrea asked 15/11, 2019 at 13:34
2
I am working with Http interceptor and trying to retry the failed request to handle 401 error. I am trying to set a new header to update the request but it's not working.
I noticed that My header ...
Galbraith asked 11/1, 2018 at 5:45
3
Solved
I am trying to use an interceptor to handle http errors and retry for a special error status, in my case the status code 502.
intercept(request: HttpRequest<any>, next: HttpHandler): Observa...
Mock asked 17/2, 2019 at 12:9
9
Solved
As you know it's possible to use Interceptors in new versions of Angular 4.
In mine, I want to cancel a request in interceptor in some conditions.
So is it possible? Maybe what I should ask is: whi...
Volnak asked 26/9, 2017 at 19:1
5
Solved
I do have a core module with an HttpInterceptor for authorization handling and I include this module in AppModule, in this way all the other modules that use HttpClient are using this interceptor.
...
Holt asked 28/9, 2017 at 12:35
3
Solved
I have an angular application with an HttpInterceptor that catch the http errors to show some dialog, common to all my application.
I would like to disable the interceptor for some specific calls...
Inessive asked 26/2, 2020 at 23:22
3
Aim: to have a global error handler for server errors and app errors (produced in Typescript code).
How: providing a custom ErrorHandler from a lib project inside the same workspace. This is my li...
Rumney asked 28/2, 2019 at 21:38
2
Does anyone know is it possible to intercept the requests made to firebase cloudstore with AngularFire library ?
I would like to implement a functionality that shows a toast message in the angular...
Tigges asked 11/5, 2019 at 5:32
11
How to cancel/abort all pending HTTP requests in angular 4+.
There is an unsubscribe method to cancel HTTP Requests but how to cancel all pending requests all at once.
Especially while route change...
Skilken asked 6/9, 2017 at 7:8
2
Solved
I have imported HttpClientModule in AppModule.
import { HttpClientModule } from '@angular/common/http';
export const AppRoutes: Routes = [
{ path: '', redirectTo: 'dashboard', pathMatch: 'full'...
Tortricid asked 14/11, 2018 at 17:24
3
Solved
I have following implementation of HTTP interceptors with Angular ^4.3.6.
import {Injectable} from "@angular/core";
import {
HttpInterceptor,
HttpHandler,
HttpRequest,
HttpEvent,
HttpResponse...
Hyperbaton asked 27/11, 2017 at 17:18
2
I'm using an HTTP interceptor in order to add auth token to requests but when the http client fires the request, this is intercepted and sent twice
This is my HttpClient call
searchProd(query: s...
Treatise asked 4/5, 2019 at 11:28
8
Solved
i am new to angular 5 . How to code a common function to show spinner for every HTTP request in angular 5.Please help me to implement this.
Ante asked 30/4, 2018 at 12:17
2
Solved
I am having a use case where I need to limit the number of outgoing http requests. Yes, I do have rate limiter on the server-side but a limit on the number of active http requests is also need on t...
Harrod asked 18/1, 2021 at 22:0
2
Solved
I have a application that uses a plugin that register a HttpInterceptor.
Now I need to create my own interceptor that need to be run before the other interceptor because it will change some values...
Charlinecharlock asked 4/7, 2018 at 13:10
2
Recently I have been using Interceptors with Angular HttpClient.
I add headers corresponding to some HTTP GET methods and for some I do not need those headers.
How can I tell my interceptor to co...
Blindage asked 20/8, 2017 at 10:58
3
I have a simple Angular 5 application with a HttpInterceptor that notifies a service when a request is made. Components can subscribe to this service to get this information.
Full example with err...
Triolein asked 19/2, 2018 at 16:50
8
Solved
I am receiving the following strange dependency injection behavior when using custom HttpInterceptors in angular 5+.
The following simplified code works fine:
export class AuthInterceptor implem...
Coucal asked 17/1, 2018 at 5:31
3
So I created an angular2 module to handle HTTP Intercepting, using a basic interceptor like so:
@Injectable()
export class RequestInterceptor implements HttpInterceptor {
constructor(private inje...
Gilt asked 12/2, 2018 at 22:45
1 Next >
© 2022 - 2025 — McMap. All rights reserved.