Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

154
Vistas
How to implement an Axios interceptor for batching requests?

I have an API that takes comma-separated or an array of ids and sends a response for each id if it's available on the server

https://europe-west1-quickstart-1573558070219.cloudfunctions.net/file-batch-api?ids=fileid1,fileid2,fileid3

If a file with id cannot be found or returns an error, it is not provided in the response items array. For example, if fileid1, fileid2, and fileid3 are requested, but fileid3 cannot be found, the return value is: items: [{id: "fileid1"}, {id: "fileid2"}]

I have created an axios interceptor that combines the params of the incoming requests, cancels the requests and sends a single request with all the params. This seems to be working and I get the data in the interceptor, but I'm unable to get the response back to the original HTTP caller in App.js How do I get the final response back in my original call?

I have created a Stackblitz example here.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda