Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

153
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!