I have a list of IDs i.e: [3,6,7] I want to fetch all objects from api which have 3,6 and 7 as id. I can fetch it with only one ID. like this:
const response = await fetch(`http://localhost:3000/api`, {
method: 'POST',
headers: {
'Content-Type': 'application/json; charset=utf-8',
},
body: JSON.stringify({
id: 7,
}),
});
How can I fetch with different ids? thanks in advance.
response = await Promise.all([fetch(...id1), fetch(...id2), fetch(...id3)])