|
各位大侠,下午好!我自己get一个url,然后用转变工具抓包,发现RedirectURL为A(url),Cookie没有值,
同样的url我直接用浏览器去访问抓包,发现RedirectURL为B(url),Cookie有值,这是为什么呢?是不是httphelper重定向不对吗?应该怎么做?
下面是我get的代码
public string getHttpRquest(string url, string referer)
{
HttpHelper httpHelper = new HttpHelper();
HttpItem item = new HttpItem
{
URL = url,
Method = "get",
IsToLower = false,
Referer = referer,
Timeout = this.timeout,
ReadWriteTimeout = this.readWriteTimeout,
UserAgent = this.userAgent,
ContentType = this.contentType,
Allowautoredirect = true,
ProxyIp = this.proxy,
ResultCookieType = ResultCookieType.CookieCollection,
CookieCollection = this.cc_gb,
KeepAlive=true,
AutoRedirectCookie=true,
Cookie= this.cookie_gb,
};
item.Header.Add("X-Requested-With", "XMLHttpRequest");
HttpResult html = httpHelper.GetHtml(item);
if (html.CookieCollection != null && cc_gb != null)
{
this.cc_gb.Add(html.CookieCollection);
}
this.cookie_gb = html.Cookie;
return html.Html;
}
|
|