[C#] 纯文本查看 复制代码
/// <summary>
/// 快速请求方法FastRequest(极速请求不接收数据,只做提交)不返回Header、Cookie、Html
/// </summary>
/// <param name="item">参数类对象</param>
/// <returns>返回HttpResult类型</returns>
public HttpResult FastRequest(HttpItem item)
[C#] 纯文本查看 复制代码
//创建Httphelper对象
HttpHelper http = new HttpHelper();
//创建Httphelper参数对象
HttpItem item = new HttpItem()
{
URL = "http://www.sufeinet.com",//URL 必需项
Method = "get",//URL 可选项 默认为Get
ContentType = "text/html",//返回类型 可选项有默认值
//ContentType = "application/x-www-form-urlencoded",//返回类型 可选项有默认值
};
//请求的返回值对象
HttpResult result = http.FastRequest(item);
//状态码
HttpStatusCode code = result.StatusCode;
//状态描述
string Des = result.StatusDescription;
if (code == HttpStatusCode.OK)
{
//状态为200
}