|
我使用你这个类库,模拟登录12306的网站,能正确获取到验证码,然后POST登录时老是返回如下信息
{"validateMessagesShowId":"_validatorMessage","status":true,"httpstatus":200,"data":{},"messages":["网络忙,请刷新重试!"],"validateMessages":{}}
模拟登录的代码如下
string m_MainUrl = "https://kyfw.12306.cn/otn/login/loginAysnSuggest";
string data = "loginUserDTO.user_name=" + strName + "&userDTO.password=" + strPsWord + "&randCode=" + RandCode;
HttpHelper http = new HttpHelper();
HttpItem item = new HttpItem()
{
URL = m_MainUrl,//URL 必需项
Method = "POST",//URL 可选项 默认为Get
Postdata = data,//Post数据 可选项GET时不需要写
Cookie=p_Cookies, //这个我在获取验证码时拿到保存,这时再传入
ResultType = ResultType.Byte
};
HttpResult result = http.GetHtml(item);
string m_LoginReturnCode = result.Html;
不知道是什么原因,请各位指点下。
谢谢
|
|