原始的cookie格式为:
key1=value1;key2=value2;.....
通过一下方法:
ReturnValue<string> cookiesResult = CookieChangeTools.ConvertToXQYCookieString(cookies, rootUrl);
cookies = cookiesResult.Value;
转换的cookie格式为:
[cookieStart]key1=value1;key2=value2;.....[cookieEnd]
该格式的使用:
CustomerInfo.LoginCookies = cookies;
参数中InputCookies,为原始的cookie格式。
baseVar.InputCookies转为放入头部header:
string cookies = baseVar.InputCookies.ToCookiesAsNameValue();
baseVar.InputCookies = "";
baseVar.setArg.cst_RequestHeaderCookies = cookies;
baseVar.setArg.cst_是否在访问网址后面加上随机参数 = false;
baseVar.rs_Page = HttpWebRequestCustom.GetPage<string>(baseVar.url, baseVar.para, baseVar.encodingUTF8, baseVar.InputCookies, baseVar.setArg);
标签:cookies,InputCookies,258,cookie,setArg,格式,baseVar
From: https://blog.51cto.com/u_14816966/9355921