有什么可能的方法可以使用 Node.js 更快地发送 GET 请求

Is there any possible way I can send GET requests faster with Node.js?

本文关键字:请求 GET js Node 什么 方法 可以使      更新时间:2023-09-26

我目前正在使用Node.js,我想尽快在一个循环中发送多个请求。我的意思是,它们很快被连续发送。我能将它们发送到远处的最快方法是使用 for 循环。下面是一个示例:

request({
            url: "http://search.roblox.com/catalog/json?CatalogContext=1&CreatorID=1&CurrencyType=0&pxMin=0&pxMax=0&SortType=0&SortAggregation=3&SortCurrency=0&IncludeNotForSale=true&LegendExpanded=true&Category=0&PageNumber=" + (pageNumber++),
            method: 'GET'
        }, function(err, res, body) {
// do stuff here
});

您可以使用 async.parallel 来完成此任务。