Method | Description | |
---|---|---|
AsUrlData ( this data ) : string |
将 URL 中的参数名称/值编码为合法的格式。 可以解决类似这样的问题:假设参数名为 tvshow, 参数值为 Tom&Jerry,如果不编码,可能得到的网址: http://a.com/?tvshow=Tom&Jerry&year=1965 编码后则为:http://a.com/?tvshow=Tom%26Jerry&year=1965 实践中经常导致问题的字符有:'&', '?', '=' 等
|
|
FillFormDataStream ( string>.this |
填充表单信息的Stream
|
|
FillFormDataStreamAsync ( string>.this |
填充表单信息的Stream
|
|
GetQueryString ( string>.this |
组装QueryString的方法 参数之间用&连接,首位没有符号,如:a=1&b=2&c=3
|
|
HtmlDecode ( this html ) : string |
封装System.Web.HttpUtility.HtmlDecode
|
|
HtmlEncode ( this html ) : string |
封装System.Web.HttpUtility.HtmlEncode
|
|
HttpGet ( string url, |
使用Get方法获取字符串结果(加入Cookie)
|
|
HttpGet ( string url, |
使用Get方法获取字符串结果(没有加入Cookie)
|
|
HttpGetAsync ( string url, |
使用Get方法获取字符串结果(加入Cookie)
|
|
HttpGetAsync ( string url, |
使用Get方法获取字符串结果(没有加入Cookie)
|
|
HttpPost ( string url, |
使用Post方法获取字符串结果,常规提交
|
|
HttpPost ( string url, |
使用Post方法获取字符串结果
|
|
HttpPostAsync ( string url, |
使用Post方法获取字符串结果,常规提交
|
|
HttpPostAsync ( string url, |
使用Post方法获取字符串结果
|
|
RemoveHttpProxy ( ) : void |
清除Web代理状态
|
|
SetHttpProxy ( string host, string port, string username, string password ) : void |
设置Web代理
|
|
UrlDecode ( this url ) : string |
封装System.Web.HttpUtility.UrlDecode
|
|
UrlEncode ( this url ) : string |
封装System.Web.HttpUtility.UrlEncode
|
Method | Description | |
---|---|---|
CheckValidationResult ( object sender, |
验证服务器证书
|
|
IsWeixinClientRequest ( this httpContext ) : bool |
public static AsUrlData ( this data ) : string | ||
data | this | |
return | string |
public static FillFormDataStream ( string>.this |
||
formData | string>.this | |
stream | Stream | |
return | void |
public static FillFormDataStreamAsync ( string>.this |
||
formData | string>.this | |
stream | Stream | |
return | System.Threading.Tasks.Task |
public static GetQueryString ( string>.this |
||
formData | string>.this | |
return | string |
public static HtmlDecode ( this html ) : string | ||
html | this | |
return | string |
public static HtmlEncode ( this html ) : string | ||
html | this | |
return | string |
public static HttpGet ( string url, |
||
url | string | |
cookieContainer | ||
encoding | ||
cer | 证书,如果不需要则保留null | |
timeOut | int | |
return | string |
public static HttpGet ( string url, |
||
url | string | |
encoding | ||
return | string |
public static HttpGetAsync ( string url, |
||
url | string | |
cookieContainer | ||
encoding | ||
cer | 证书,如果不需要则保留null | |
timeOut | int | |
return | Task |
public static HttpGetAsync ( string url, |
||
url | string | |
encoding | ||
return | Task |
public static HttpPost ( string url, |
||
url | string | |
cookieContainer | ||
formData | string>.Dictionary | |
encoding | ||
cer | ||
timeOut | int | |
return | string |
public static HttpPost ( string url, |
||
url | string | |
cookieContainer | ||
postStream | Stream | |
fileDictionary | string>.Dictionary | 需要上传的文件,Key:对应要上传的Name,Value:本地文件名 |
refererUrl | string | |
encoding | ||
cer | 证书,如果不需要则保留null | |
timeOut | int | |
checkValidationResult | bool | 验证服务器证书回调自动验证 |
return | string |
public static HttpPostAsync ( string url, |
||
url | string | |
cookieContainer | ||
formData | string>.Dictionary | |
encoding | ||
cer | ||
timeOut | int | |
return | Task |
public static HttpPostAsync ( string url, |
||
url | string | |
cookieContainer | ||
postStream | Stream | |
fileDictionary | string>.Dictionary | 需要上传的文件,Key:对应要上传的Name,Value:本地文件名 |
refererUrl | string | |
encoding | ||
cer | ||
timeOut | int | |
checkValidationResult | bool | 验证服务器证书回调自动验证 |
return | Task |
public static SetHttpProxy ( string host, string port, string username, string password ) : void | ||
host | string | |
port | string | |
username | string | |
password | string | |
return | void |
public static UrlDecode ( this url ) : string | ||
url | this | |
return | string |
public static UrlEncode ( this url ) : string | ||
url | this | |
return | string |