BetterHttpClient.ProxyManager.DownloadBytes C# (CSharp) Метод

DownloadBytes() приватный Метод

private DownloadBytes ( string url, NameValueCollection data, Proxy proxy, CookieContainer cookies = null, NameValueCollection customHeaders = null ) : byte[]
url string
data System.Collections.Specialized.NameValueCollection
proxy Proxy
cookies System.Net.CookieContainer
customHeaders System.Collections.Specialized.NameValueCollection
Результат byte[]
        private byte[] DownloadBytes(string url, NameValueCollection data, Proxy proxy, CookieContainer cookies = null, NameValueCollection customHeaders = null)
        {
            HttpClient client = CreateHttpClient(customHeaders);
            client.Proxy = proxy;
            if (cookies != null) client.Cookies = cookies;

            try
            {
                return client.DownloadBytes(url, data);
            }
            catch (WebException e)
            {
                if (e.Response != null && (e.Response as HttpWebResponse).StatusCode == HttpStatusCode.NotFound)
                    throw new WebPageNotFoundException();
                proxy.IsOnline = false;
            }

            return null;
        }
        private HttpClient CreateHttpClient(NameValueCollection customHeaders = null)

Same methods

ProxyManager::DownloadBytes ( string url, CookieContainer cookies = null, NameValueCollection customHeaders = null ) : byte[]
ProxyManager::DownloadBytes ( string url, NameValueCollection data, CookieContainer cookies = null, NameValueCollection customHeaders = null ) : byte[]