POST http://192.168.1.1/wh/Login HTTP/1.1
Content-Type: multipart/form-data; boundary=---------------------------7b4a6d158c9
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
Host: 192.168.1.1
Connection: Keep-Alive
Content-Length: 351
Pragma: no-cache
-----------------------------7b4a6d158c9
Content-Disposition: form-data; name="username"00001
-----------------------------7b4a6d158c9
Content-Disposition: form-data; name="password"123-----------------------------7b4a6d158c9
Content-Disposition: form-data; name="submitted"submitted
-----------------------------7b4a6d158c9--
上面只是一个简单的POST数据包 使用了multipart方法,发送方是一个体检机,我没法控制
我在我的电脑上用C#、网页表单分别模拟了这个流程,都可以实现,但是一到这个机器上就不行
用抓包工具抓到的流如上,我应该怎样才能获得其中的数据?
我现在用的是这个方法:
SmartUpload su=new SmartUpload();
su.initialize(getServletConfig(), request, response);
su.setMaxFileSize(2000000);
try {
su.upload();
} catch (SmartUploadException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String usrn=su.getRequest().getParameter("username");
String pasw=su.getRequest().getParameter("password");
这个在接受网页和C#的时候都好使但是一旦上了真机,获得的数据都是null了
求各位给看看吧ServletHTTP