C# Class Tup.Utilities.RequestHelper

HttpRequest 助手
POST 功能没有详细测试
Exibir arquivo Open project: tupunco/Tup.Utilities

Public Methods

Method Description
DownLoadHtml ( string url ) : string

GET 方式下载指定 URL 的 HTML 内容

DownLoadHtml ( string url, bool isPost, string>.IEnumerable postData ) : string

POST 方式下载指定 URL 的 HTML 内容

DownLoadHtml ( string url, string headerReferer, Encoding pageEncoding ) : string

GET 方式下载指定 URL 的 HTML 内容, 本方法可指定待下载页面的引用页面和页面编码

DownLoadHtml ( string url, string headerReferer, Encoding pageEncoding, IWebProxy webProxy ) : string

GET 方式下载指定 URL 的 HTML 内容, 本方法可指定待下载页面的引用页面/页面编码/HTTP 代理

DownLoadHtml ( string url, string headerReferer, Encoding pageEncoding, int timeout, IWebProxy webProxy ) : string

GET 方式下载指定 URL 的 HTML 内容, 本方法可指定待下载页面的引用页面/页面编码/下载超时时间/HTTP 代理

DownLoadHtml ( string url, string headerReferer, bool isPost, string>.IEnumerable postData ) : string

POST 方式下载指定 URL 的 HTML 内容, 本方法可指定待下载页面的引用页面

DownLoadHtml ( string url, string headerReferer, bool isPost, string>.IEnumerable postData, Encoding pageEncoding ) : string

POST 方式下载指定 URL 的 HTML 内容, 本方法可指定待下载页面的引用页面和页面编码

DownLoadHtml ( string url, string headerReferer, bool isPost, string>.IEnumerable postData, Encoding pageEncoding, int timeout, IWebProxy webProxy ) : string

POST 方式下载指定 URL 的 HTML 内容, 本方法可指定待下载页面的引用页面/页面编码/下载超时时间/HTTP 代理

DownLoadStream ( string url, string headerReferer, bool isPost, byte postData, int timeout, IWebProxy webProxy ) : Stream

PSOT 方式下载指定 URL 的流数据内容, 本方法可指定待下载页面的引用页面/页面编码/下载超时时间/HTTP 代理

DownLoadStream ( string url, string headerReferer, int timeout, IWebProxy webProxy ) : Stream

GET 方式下载指定 URL 的流数据内容, 本方法可指定待下载页面的引用页面/下载超时时间/HTTP 代理

Method Details

DownLoadHtml() public static method

GET 方式下载指定 URL 的 HTML 内容
url is null
public static DownLoadHtml ( string url ) : string
url string 待下载 URL
return string

DownLoadHtml() public static method

POST 方式下载指定 URL 的 HTML 内容
url is null
public static DownLoadHtml ( string url, bool isPost, string>.IEnumerable postData ) : string
url string 待下载 URL
isPost bool 是否 POST 方式下载页面
postData string>.IEnumerable POST 方式下载页面的参数
return string

DownLoadHtml() public static method

GET 方式下载指定 URL 的 HTML 内容, 本方法可指定待下载页面的引用页面和页面编码
url is null
public static DownLoadHtml ( string url, string headerReferer, Encoding pageEncoding ) : string
url string 待下载 URL
headerReferer string 待下载页面的引用页
pageEncoding System.Text.Encoding 待下载页面的页面编码
return string

DownLoadHtml() public static method

GET 方式下载指定 URL 的 HTML 内容, 本方法可指定待下载页面的引用页面/页面编码/HTTP 代理
url is null
public static DownLoadHtml ( string url, string headerReferer, Encoding pageEncoding, IWebProxy webProxy ) : string
url string 待下载 URL
headerReferer string 待下载页面的引用页
pageEncoding System.Text.Encoding 待下载页面的页面编码
webProxy IWebProxy 当前下载操作使用的 HTTP 代理
return string

DownLoadHtml() public static method

GET 方式下载指定 URL 的 HTML 内容, 本方法可指定待下载页面的引用页面/页面编码/下载超时时间/HTTP 代理
url is null
public static DownLoadHtml ( string url, string headerReferer, Encoding pageEncoding, int timeout, IWebProxy webProxy ) : string
url string 待下载 URL
headerReferer string 待下载页面的引用页
pageEncoding System.Text.Encoding 待下载页面的页面编码
timeout int 下载页面的超时时间, -1 将忽略本项, 单位:毫秒
webProxy IWebProxy 当前下载操作使用的 HTTP 代理
return string

DownLoadHtml() public static method

POST 方式下载指定 URL 的 HTML 内容, 本方法可指定待下载页面的引用页面
url is null
public static DownLoadHtml ( string url, string headerReferer, bool isPost, string>.IEnumerable postData ) : string
url string 待下载 URL
headerReferer string 待下载页面的引用页
isPost bool 是否 POST 方式下载页面
postData string>.IEnumerable POST 方式下载页面的参数
return string

DownLoadHtml() public static method

POST 方式下载指定 URL 的 HTML 内容, 本方法可指定待下载页面的引用页面和页面编码
url is null
public static DownLoadHtml ( string url, string headerReferer, bool isPost, string>.IEnumerable postData, Encoding pageEncoding ) : string
url string 待下载 URL
headerReferer string 待下载页面的引用页
isPost bool 是否 POST 方式下载页面
postData string>.IEnumerable POST 方式下载页面的参数
pageEncoding System.Text.Encoding 待下载页面的页面编码
return string

DownLoadHtml() public static method

POST 方式下载指定 URL 的 HTML 内容, 本方法可指定待下载页面的引用页面/页面编码/下载超时时间/HTTP 代理
url is null
public static DownLoadHtml ( string url, string headerReferer, bool isPost, string>.IEnumerable postData, Encoding pageEncoding, int timeout, IWebProxy webProxy ) : string
url string 待下载 URL
headerReferer string 待下载页面的引用页
isPost bool 是否 POST 方式下载页面
postData string>.IEnumerable POST 方式下载页面的参数
pageEncoding System.Text.Encoding 待下载页面的页面编码
timeout int 下载页面的超时时间, -1 将忽略本项, 单位:毫秒
webProxy IWebProxy 当前下载操作使用的 HTTP 代理
return string

DownLoadStream() public static method

PSOT 方式下载指定 URL 的流数据内容, 本方法可指定待下载页面的引用页面/页面编码/下载超时时间/HTTP 代理
url is null
public static DownLoadStream ( string url, string headerReferer, bool isPost, byte postData, int timeout, IWebProxy webProxy ) : Stream
url string 待下载 URL
headerReferer string 待下载页面的引用页
isPost bool 是否 POST 方式下载页面
postData byte POST 方式下载页面的参数
timeout int 下载页面的超时时间, -1 将忽略本项, 单位:毫秒, 默认值为 100,000 毫秒
webProxy IWebProxy 当前下载操作使用的 HTTP 代理
return Stream

DownLoadStream() public static method

GET 方式下载指定 URL 的流数据内容, 本方法可指定待下载页面的引用页面/下载超时时间/HTTP 代理
url is null
public static DownLoadStream ( string url, string headerReferer, int timeout, IWebProxy webProxy ) : Stream
url string 待下载 URL
headerReferer string 待下载页面的引用页
timeout int 下载页面的超时时间, -1 将忽略本项, 单位:毫秒
webProxy IWebProxy 当前下载操作使用的 HTTP 代理
return Stream