Ejemplo n.º 1
0
        public async Task <string> DownloadStringAsync(string url)
        {
            using (CompressionWebClient webClient = new CompressionWebClient(EnableCompression)
            {
                Encoding = Encoding.UTF8
            })
            {
                foreach (KeyValuePair <string, string> headerEntry in Headers)
                {
                    webClient.Headers[headerEntry.Key] = headerEntry.Value;
                }

                return(await webClient.DownloadStringTaskAsync(url).ConfigureAwait(false));
            }
        }