async function main() {
const ids = [1, 2, 3, 4, 5, 6, 7]
return Promise.all(ids.map(fetch))
}
async function fetch(id) {
try {
const response = await new RestClient('something').get(`https://some_url/entity/${id}`)
const result = response.result
return result
} catch(e) {
return {}
}
}
Requests for some of the IDs return response code 404. Whenever this happens, several other IDs, which would normally return a positive response, also returned as 404. If all of the IDs have a positive response, then it works fine.
I am trying to use RestClient as follows:
Requests for some of the IDs return response code 404. Whenever this happens, several other IDs, which would normally return a positive response, also returned as 404. If all of the IDs have a positive response, then it works fine.