转自:http://shengmo8611.iteye.com/blog/853034
使用httpClient模拟登陆校内网并留言
首先我使用的是一个叫做iehttpHeader的IE浏览器的插件将前传后打开IE浏览器后点击查看–iehttpHeader浏览器下方就 会出现交互信息了其安装件我已经放在附件里了如果你有火狐的话最好配合火狐debug一起使用因为有些时候iehttpheader得到的头部信息并不十 分的完整..我将我的
一部分头部信息以及代码凉一下,大家见笑了
登陆的头部信息:
Java语言: 高亮代码由发芽网提供
[color=brown]POST /PLogin.do HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/msword,application/vnd.ms-excel, application/vnd.ms-powerpoint, application/QVOD, application/QVOD, */*
Referer: http://www.renren.com/PLogin.do
Accept-Language: zh-cn
Content-Type: application/x-www-form-urlencoded
UA-CPU: x86
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727)
Host: www.renren.com
Content-Length: 171
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: ick=c7782bec-a19a-4177-a4d8-ea2517415e6c; _r01_=1; _de=25733BD8775D04BB608BA0DF927B991F5212E40F3D18115C
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/msword,application/vnd.ms-excel, application/vnd.ms-powerpoint, application/QVOD, application/QVOD, */*
Referer: http://www.renren.com/PLogin.do
Accept-Language: zh-cn
Content-Type: application/x-www-form-urlencoded
UA-CPU: x86
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727)
Host: www.renren.com
Content-Length: 171
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: ick=c7782bec-a19a-4177-a4d8-ea2517415e6c; _r01_=1; _de=25733BD8775D04BB608BA0DF927B991F5212E40F3D18115C
email=cuiqiang8611@163.com&password=0532cuiqiang0532&origURL=http%3A%2F%2Fwww.renren.com%2Fhome&domain=renren.com&formName=&method=&isplogin=true&submit=%E7%99%BB%E5%BD%95[/color]