'Can you send multiple fetch post requests simultaneously to avoid rate limits?
Scenario: I have a script that uses node-fetch to GET a list of 200 users from a website, then update a variable for those users with POST to give/remove access to a restricted area. It does this for 8 different areas.
GET returns 30 users at a time, so it takes 7 requests. POST is currently handling one user at a time, so 200 requests. You can see this adds up quickly.
Question: Is there a way to send multiple POST requests at once to avoid the rate limit set by the website? They don't appear to have an option to pass an array of users to add/remove their access. Ideally I'd like to do something like:
let scriptToAddUser = [an array of body elements that individually add a single user];
let res = await fetch (...., {
...
body: scriptToAddUser
}
Or maybe something using .then()?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
