C# Class Shadowsocks.Nladuo.HttpWebResponseUtility

有关HTTP请求的辅助类
Datei anzeigen Open project: nladuo/AutoShadowsocks Class Usage Examples

Public Methods

Method Description
CreateGetHttpResponse ( string url, int timeout, string userAgent, CookieCollection cookies ) : HttpWebResponse

创建GET方式的HTTP请求

CreatePostHttpResponse ( string url, string>.IDictionary parameters, int timeout, string userAgent, Encoding requestEncoding, CookieCollection cookies ) : HttpWebResponse

创建POST方式的HTTP请求

Private Methods

Method Description
CheckValidationResult ( object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors ) : bool

Method Details

CreateGetHttpResponse() public static method

创建GET方式的HTTP请求
public static CreateGetHttpResponse ( string url, int timeout, string userAgent, CookieCollection cookies ) : HttpWebResponse
url string 请求的URL
timeout int 请求的超时时间
userAgent string 请求的客户端浏览器信息,可以为空
cookies System.Net.CookieCollection 随同HTTP请求发送的Cookie信息,如果不需要身份验证可以为空
return System.Net.HttpWebResponse

CreatePostHttpResponse() public static method

创建POST方式的HTTP请求
public static CreatePostHttpResponse ( string url, string>.IDictionary parameters, int timeout, string userAgent, Encoding requestEncoding, CookieCollection cookies ) : HttpWebResponse
url string 请求的URL
parameters string>.IDictionary 随同请求POST的参数名称及参数值字典
timeout int 请求的超时时间
userAgent string 请求的客户端浏览器信息,可以为空
requestEncoding System.Text.Encoding 发送HTTP请求时所用的编码
cookies System.Net.CookieCollection 随同HTTP请求发送的Cookie信息,如果不需要身份验证可以为空
return System.Net.HttpWebResponse