Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

axios get array of urls

let linksArr = ['https://jsonplaceholder.typicode.com/posts', 'https://jsonplaceholder.typicode.com/comments'];

axios.all(linksArr.map(l => axios.get(l)))
  .then(axios.spread(function (...res) {
    // all requests are now complete
    console.log(res);
  }));
Comment

PREVIOUS NEXT
Code Example
Javascript :: JavaScript Nested Function 
Javascript :: find array in js 
Javascript :: add marker on map geocoder result mapbox 
Javascript :: javascript catch all click events 
Javascript :: calling anonymous function while declaring it 
Javascript :: delete array 
Javascript :: trim text 
Javascript :: turn off js console 
Javascript :: react usereducer hook 
Javascript :: mongodb where field is not equal 
Javascript :: get unique id angular 
Javascript :: javascript add to string 
Javascript :: sequelize date format 
Javascript :: js regex return null 
Javascript :: decode jwt tokens 
Javascript :: production server next.js 
Javascript :: why my favicon icon is not removing in react 
Javascript :: multilone input html 
Javascript :: password generator 
Javascript :: electron 
Javascript :: merge two sorted linked lists 
Javascript :: library for react table 
Javascript :: what is form data in javascript 
Javascript :: google maps address autocomplete in angular npm 
Javascript :: chatbot using html and javascript 
Javascript :: javascript detect when youtube video ends 
Javascript :: json web token flask 
Javascript :: document.ready javascript 
Javascript :: read dictionary values 
Javascript :: object destructuring es6 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =