C# Class BetterHttpClient.ProxyManager

Afficher le fichier Open project: Yozer/BetterHttpClient

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
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

Method Details

DownloadBytes() public méthode

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
Résultat byte[]

DownloadBytes() public méthode

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
Résultat byte[]

GetAllProxies() public méthode

Return all proxies
public GetAllProxies ( ) : List
Résultat List

GetAvalibleProxy() public méthode

Returns first free (but busy) and working proxy.
All proxies are banned. You can't make request.
public GetAvalibleProxy ( ) : Proxy
Résultat Proxy

GetPage() public méthode

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
Résultat string

PostPage() public méthode

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
Résultat string

ProxyManager() public méthode

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
Résultat System

ProxyManager() public méthode

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
Résultat System

ProxyManager() public méthode

public ProxyManager ( string file ) : System
file string
Résultat System

ProxyManager() public méthode

public ProxyManager ( string file, bool anonymousOnly ) : System
file string
anonymousOnly bool
Résultat System

ProxyManager() public méthode

public ProxyManager ( string file, bool anonymousOnly, BetterHttpClient.CheckService.ProxyJudgeService service ) : System
file string
anonymousOnly bool
service BetterHttpClient.CheckService.ProxyJudgeService
Résultat System

SetAllProxyAsOnline() public méthode

Sets all proxies IsOnline property to true.
public SetAllProxyAsOnline ( ) : void
Résultat void