我使用如下代码获取到了网页上的表单的提取内容后:
s = ss.accept();
is = s.getInputStream();
os = s.getOutputStream();
byte[] b = new byte[1024];
int len = is.read(b);
data = new String(b,0,len);
得到的是如下消息头字符串:
POST / HTTP/1.1
Host: 127.0.0.1:9163
Connection: keep-alive
Content-Length: 40
Cache-Control: max-age=0
Origin: null
User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1
Content-Type: application/x-www-form-urlencoded
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip,deflate,sdch
Accept-Language: zh-CN,zh;q=0.8
Accept-Charset: GBK,utf-8;q=0.7,*;q=0.3
user=aaa&psw=aaa&mail=403431550%40qq.com
但是我想要的数据只有最后一行user=aaa&psw=aaa&mail=403431550%40qq.com这个数据,那么请问我如何获取到这一行数据呢?
谢谢拉 |