I have an app that making API requests to the last.fm website using the backgroundWorker. Initially I don\'t know how many request I\'m gonna need to make. The response cont
You can take advantage of HttpClient, assume you have list of urls:
var client = new HttpClient();
var tasks = urls.Select(url => client.GetAsync(url).ContinueWith(t =>
{
var response = t.Result;
response.EnsureSuccessStatusCode();
//Do something more
}));
If you use async method, you can await all tasks finish like below:
var results = await Task.WhenAll(tasks);