Beispiel #1
0
        public Stream GetResponseStream(string url)
        {
            var request = BootstrapperHelper.PrepareWebRequest(url, envProxy);

            using (var httpResponse = (HttpWebResponse)request.GetResponse())
            {
                return(httpResponse.GetResponseStream());
            }
        }
Beispiel #2
0
        public void DownloadFile(string url, Stream stream, int bufferSize)
        {
            var request = BootstrapperHelper.PrepareWebRequest(url);

            using (var httpResponse = (HttpWebResponse)request.GetResponse())
            {
                using (var responseStream = httpResponse.GetResponseStream())
                {
                    responseStream.CopyTo(stream, bufferSize);
                }
            }
        }