I've been calling the same API but with different id
s using loop.
However I get a CORS error.
This is more of an overview of what my code looks like:
getRequest(id:string) {
return this.http.get(url+id, options);
}
tableOfIds = [...];
storeData = [];
tableOfIds.forEach(id => {
this.serv.getRequest(id).subscribe(elements => {
storeData.push(elements);
});
});
Is there a way I can call a GET request (multiple times, with different parameters) without getting a CORS error?