using CsharpHttpHelper;
//创建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",//返回类型 可选项有默认值
};
item.Header.Add("key1", "value1");
item.Header.Add("key2", "value2");
//请求的返回值对象
HttpResult result = http.GetHtml(item);
//获取请请求的Html
string html = result.Html;
//获取请求的Cookie
string cookie = result.Cookie;
lancome 发表于 2017-5-27 08:27
可否获取请求头request header的值
lancome 发表于 2017-5-27 12:04
不是要response header
wjhmiss 发表于 2020-9-10 16:18
你好,按照你的方法,下列代码报错
item.Header.Add(":authority","www.qcc.com");
item.Header.Add(":pa ...
欢迎光临 苏飞论坛 (http://www.sufeinet.com/) | Powered by Discuz! X3.4 |