BJ10086
- 访问登录页面
- 发送时间戳 timestamp
GET https://login.10086.cn/loadSendflag.htm?timestamp= HTTP/1.1
Referer: https://login.10086.cn/html/bj/iloginnew.html?1543995261660
这一步将 Set-Cookie
Set-Cookie: sendflag=20181205153357223101;domain=.10086.cn;secure;HTTPOnly;
Set-Cookie: CITY_INFO=100|10;domain=.10086.cn;path=/;expires=Mon, 29-Jun-2015 06:11:17 GMT我们需要获取其中的 sendflag 的值,设置到发送短信时的请求中,这样才能成功发送短信验证码
public boolean sendMsg() { String sendMsgUrl = "https://login.10086.cn/sendRandomCodeAction.action"; HttpPost post = new HttpPost(sendMsgUrl); post.addHeader("Origin", "https://login.10086.cn"); // X-Requested-With: XMLHttpRequest // Xa-before: 00879948406687273556266369392484 post.addHeader("X-Requested-With", "XMLHttpRequest"); post.addHeader("Xa-before", "00879948406687273556266369392484"); post.addHeader("Referer", "https://log