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

152
Views
Best way to perform numerous requests with Axios

I have a list of sites and I want each one of them with Axios, but it seems that the order of the requests is respected, besides that not all of them fall into the catch.

What is the best way to perform a sequence of requests?

Code:

async function searchContent(url) {
  try {
    let request = await axios(url);
    let content   = await request.data;
    return content;
  } catch (e) {
    return e;
  }
}

async function start() {
    sites.forEach(async (item)=>{
        let content = await searchContent(`https://${item["URL"]}`);
        //DEBUG
        console.log(content)
    })
}

Error (Error is long, so 3 prints):

https://i.stack.imgur.com/7PXMh.png

https://i.stack.imgur.com/KB0Gr.png

https://i.stack.imgur.com/tMN8M.png

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!