Skip to content

Instantly share code, notes, and snippets.

@AlexArchive
Created January 10, 2015 06:32
Show Gist options
  • Save AlexArchive/6f4e5b339893e2261621 to your computer and use it in GitHub Desktop.
Save AlexArchive/6f4e5b339893e2261621 to your computer and use it in GitHub Desktop.
static async Task<string> DownloadAllAsync(IEnumerable<string> locations)
{
var client = new HttpClient();
var downloads = locations.Select(client.GetStringAsync);
var downloadTasks = downloads.ToArray();
var pages = await Task.WhenAll(downloadTasks);
return string.Concat(pages);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment