Questions tagged [httpinterceptor]

26 questions
2
votes
1 answer

Does having multiple Angular HTTP interceptor files make request slower than a huge file of interceptors?

I'm new to Angular and trying to use HTTP interceptor here. I just wonder whether should I lump multiple interceptors, like setting headers' token, cache-control, content-type in one file, or should I separate it into token.interceptor.ts for token…
2
votes
0 answers

How to intercept all http responses in flutter?

Is there any possible way to intercept all the network responses ? For example with electron js, I can do something like, protocol.interceptBufferProtocol("http", (request, result) => { if (request.url === "http://www.example.com/encryptedkey") …
Dilshan
  • 2,797
  • 1
  • 8
  • 26
2
votes
0 answers

Intercept each http request globally in flutter http package

I have many API calls to the server, in many of them if I get a 401 response then I should forward the user to the login screen to refresh the token that I used for authorization. http.post( URL, body: jsonEncode(loginHttpBody),) …
Ali Abbas
  • 1,415
  • 12
  • 19
2
votes
2 answers

HttpInterceptor not intercepting requests in Angular 10

I have a HttpInterceptor to add a JWT token from the localstorage to the headers of my http requests. I believe that all my http requests are being sent without any headers but don't understand why it isn't working. What am I missing to make the…
KHans
  • 89
  • 2
  • 8
2
votes
1 answer

Show modal dialog from HttpInterceptor

@Injectable() export class MyInterceptor implements HttpInterceptor { intercept(req : HttpRequest, next : HttpHandler) : Observable> { //show a modal dialog to hold the request until user respond/close the dialog …
Munawar
  • 2,588
  • 2
  • 26
  • 29
1
vote
0 answers

How can I unit test a HttpInterceptor with a retry strategy in Angular using Jest?

I've created an HttpInterceptor that should globally handle errors via a generic retry strategy. Here's the implementation of the Interceptor: @Injectable() export class HttpErrorInterceptor implements HttpInterceptor { intercept( request:…
MauriceDev
  • 31
  • 7
1
vote
3 answers

Axios response interceptor for refreshing token keeps firing in Vue 3

I'm trying to implement a refresh token with Vue 3 and Java for backend. It is working but interceptor keeps firing. The logic: On every request there's a JWT Authorization header that authenticates the user. If that expires, there's a cookie…
Alexandra28
  • 31
  • 1
  • 5
1
vote
0 answers

Audit HTTP requests for concurrency users in postgreSQL with a trigger

I'm working with a spring app, that has around 150 services, so I need to audit each http event request (post, put, and delete) of each service, the audit data among others should be the user that made the http request and It has to be stored in the…
1
vote
0 answers

how can we print http flow of a browser with python? [Like browser network tab]

In Python i want to build a program like browser network tab, which prints all http/s flows. The same thing needs to be done with python. [#urllib #requests #basicHTTPRequest etc..] modules are there but how can i get the network traffic of a…
0
votes
1 answer

Angular 15 - Response body hasn't modified, but another variable has with HttpInterceptor

I want to modify the response body through HttpInterceptor. When I catch the casuistic of HttpResponse, I make a clone of the response and modify the body: return next.handle(req).pipe( map(resp => { if( resp instanceof…
0
votes
1 answer

In spring boot 3 is there an interface equivalent to feign.RequestInterceptor for webclient or http interfaces?

In feign you can implement a RequestInterceptor as follows import feign.RequestInterceptor; import feign.RequestTemplate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import…
0
votes
0 answers

Request to CommerceJS not triggering HTTPInterceptor

I am creating an Angular ecommerce website using CommerceJS for my backend. I followed a tutorial to implement a spinner across the app that is supposed to appear any time my application is waiting for a response. To do so, I use an Interceptor,…
0
votes
1 answer

React Http axios get request that is sent to Flask Server arrives without jwt that was added to its headers

I'm trying to fetch users data by sending an axios get request from a React client to a Flask server. This is my the get request: axios.get("http://10.0.0.14:5000/users") and this the interceptor the request is going through right before it's sent…
0
votes
1 answer

how to use a new MultipartFile each time when I retry

actually I am posting this question again due to some disturbance and miss communication with other developer. actually I am using http_interceptor package where I want to retry the request upon 401 response using this package but when I am retrying…
Santosh Kumar
  • 158
  • 1
  • 14
0
votes
1 answer

how to use provider without context

I am trying to call an api with the help of provider if response is 401..but provider takes a context to call a function.. in my case is there any way to call a function with out context? following is my interceptor where I want to call…
Santosh Kumar
  • 158
  • 1
  • 14
1
2