Monday, 9 December 2019

GET Request synchronous loop

How can I loop through an amount of integers and for each one make a GET request to a url ?const request = require("request"); for (var i = 1234; i < 1500; i++) { async function consoleTheResult(i) { urlString = "http://something?p=000" + i await request(urlString, function (err, res, body) { console.log(res.body); }); } } I am doing something like this. I know it's simple. How can I make this work?

Submitted December 09, 2019 at 04:45PM by tonystarkco

No comments:

Post a Comment