在模拟登录的时候,密码是加密提交的,分析js后得知,填写用户名之后客户端通过ajax向服务器获取json,再将请求到的数据和密码一起进行加密,于是想先获取json,但是模拟请求却返回405错误
如下:
HTTP/1.1 100 Continue HTTP/1.1 405 Method Not Allowed Date: Wed, 29 Jun 2016 12:51:25 GMT Transfer-Encoding: chunked Connection: keep-alive Server: nginx/1.8.0 Pragma: No-cache Cache-Control: no-cache Expires: Thu, 01 Jan 1970 00:00:00 GMT Allow: GET但是客户端请求的方法的确是POST,而且头信息我全都模拟了
研究3天了都没搞定。。有木有大神来帮看看什么原因,登录地址:http://v.laifeng.com/login/init?init=login
请求加密json地址:http://v.laifeng.com/login/init?init=login(GET方法404)
如下:
HTTP/1.1 100 Continue HTTP/1.1 405 Method Not Allowed Date: Wed, 29 Jun 2016 12:51:25 GMT Transfer-Encoding: chunked Connection: keep-alive Server: nginx/1.8.0 Pragma: No-cache Cache-Control: no-cache Expires: Thu, 01 Jan 1970 00:00:00 GMT Allow: GET但是客户端请求的方法的确是POST,而且头信息我全都模拟了
研究3天了都没搞定。。有木有大神来帮看看什么原因,登录地址:http://v.laifeng.com/login/init?init=login
请求加密json地址:http://v.laifeng.com/login/init?init=login(GET方法404)
CURLOPT_USERAGENT
{
$postdata = array('userName'=>"13246511");
$ch_post = curl_init();
curl_setopt($ch_post,CURLOPT_URL,"http://v.laifeng.com/captcha/isneed");
curl_setopt($ch_post,CURLOPT_HEADER,0);
curl_setopt($ch_post,CURLOPT_POST, 1); // 设置为post;
curl_setopt($ch_post,CURLOPT_POSTFIELDS,$postdata);//提交数据
curl_exec($ch_post);
curl_close($ch_post);
}