C# Класс BetterHttpClient.ProxyManager

Показать файл Открыть проект

Открытые методы

Метод Описание
DownloadBytes ( string url, CookieContainer cookies = null, NameValueCollection customHeaders = null ) : byte[]

Downloads url using GET.

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

Downloads url using POST.

GetAllProxies ( ) : List

Return all proxies

GetAvalibleProxy ( ) : Proxy

Returns first free (but busy) and working proxy.

GetPage ( string url, string requiredString = null, CookieContainer cookies = null, NameValueCollection customHeaders = null ) : string

Downloads url using GET.

PostPage ( string url, NameValueCollection data, string requiredString = null, CookieContainer cookies = null, NameValueCollection customHeaders = null ) : string

Downloads url using POST.

ProxyManager ( IEnumerable proxies, bool anonymousOnly, BetterHttpClient.CheckService.ProxyJudgeService proxyJudgeService ) : System
ProxyManager ( IEnumerable proxies, bool anonymousOnly, BetterHttpClient.CheckService.ProxyJudgeService proxyJudgeService ) : System
ProxyManager ( string file ) : System
ProxyManager ( string file, bool anonymousOnly ) : System
ProxyManager ( string file, bool anonymousOnly, BetterHttpClient.CheckService.ProxyJudgeService service ) : System
SetAllProxyAsOnline ( ) : void

Sets all proxies IsOnline property to true.

Приватные методы

Метод Описание
CloneProxyList ( List proxyInput ) : List
CreateHttpClient ( NameValueCollection customHeaders = null ) : HttpClient
DownloadBytes ( string url, NameValueCollection data, Proxy proxy, CookieContainer cookies = null, NameValueCollection customHeaders = null ) : byte[]
ParseProxies ( IEnumerable proxies ) : IEnumerable

Описание методов

DownloadBytes() публичный Метод

Downloads url using GET.
Page has returned 404 not found
public DownloadBytes ( string url, CookieContainer cookies = null, NameValueCollection customHeaders = null ) : byte[]
url string
cookies System.Net.CookieContainer
customHeaders System.Collections.Specialized.NameValueCollection Specify custom headers for this request
Результат byte[]

DownloadBytes() публичный Метод

Downloads url using POST.
Page has returned 404 not found
public DownloadBytes ( string url, NameValueCollection data, CookieContainer cookies = null, NameValueCollection customHeaders = null ) : byte[]
url string Url of webpage
data System.Collections.Specialized.NameValueCollection Post values
cookies System.Net.CookieContainer Cookies for request. Left null if you don't want to use cookies
customHeaders System.Collections.Specialized.NameValueCollection Specify custom headers for this request
Результат byte[]

GetAllProxies() публичный Метод

Return all proxies
public GetAllProxies ( ) : List
Результат List

GetAvalibleProxy() публичный Метод

Returns first free (but busy) and working proxy.
All proxies are banned. You can't make request.
public GetAvalibleProxy ( ) : Proxy
Результат Proxy

GetPage() публичный Метод

Downloads url using GET.
Page has returned 404 not found
public GetPage ( string url, string requiredString = null, CookieContainer cookies = null, NameValueCollection customHeaders = null ) : string
url string Url of webpage
requiredString string
cookies System.Net.CookieContainer Cookies for request. Left null if you don't want to use cookies
customHeaders System.Collections.Specialized.NameValueCollection Specify custom headers for this request
Результат string

PostPage() публичный Метод

Downloads url using POST.
Page has returned 404 not found
public PostPage ( string url, NameValueCollection data, string requiredString = null, CookieContainer cookies = null, NameValueCollection customHeaders = null ) : string
url string Url of webpage
data System.Collections.Specialized.NameValueCollection Post values
requiredString string
cookies System.Net.CookieContainer Cookies for request. Left null if you don't want to use cookies
customHeaders System.Collections.Specialized.NameValueCollection Specify custom headers for this request
Результат string

ProxyManager() публичный Метод

public ProxyManager ( IEnumerable proxies, bool anonymousOnly, BetterHttpClient.CheckService.ProxyJudgeService proxyJudgeService ) : System
proxies IEnumerable Proxy list
anonymousOnly bool Set true if you want to filter proxy list and use only anonymous only
proxyJudgeService BetterHttpClient.CheckService.ProxyJudgeService Proxy judge service is used to determine proxy anonymity level
Результат System

ProxyManager() публичный Метод

public ProxyManager ( IEnumerable proxies, bool anonymousOnly, BetterHttpClient.CheckService.ProxyJudgeService proxyJudgeService ) : System
proxies IEnumerable Proxy list
anonymousOnly bool Set true if you want to filter proxy list and use only anonymous only
proxyJudgeService BetterHttpClient.CheckService.ProxyJudgeService Proxy judge service is used to determine proxy anonymity level
Результат System

ProxyManager() публичный Метод

public ProxyManager ( string file ) : System
file string
Результат System

ProxyManager() публичный Метод

public ProxyManager ( string file, bool anonymousOnly ) : System
file string
anonymousOnly bool
Результат System

ProxyManager() публичный Метод

public ProxyManager ( string file, bool anonymousOnly, BetterHttpClient.CheckService.ProxyJudgeService service ) : System
file string
anonymousOnly bool
service BetterHttpClient.CheckService.ProxyJudgeService
Результат System

SetAllProxyAsOnline() публичный Метод

Sets all proxies IsOnline property to true.
public SetAllProxyAsOnline ( ) : void
Результат void