标签:
在之前一段的项目中,使用Java模仿Http Post方式发送参数以及文件,单纯的传递参数或者文件可以使用URLConnection进行相应的处理。
但是项目中涉及到既要传递普通参数,也要传递多个文件(不是单纯的传递XML文件)。在网上寻找之后,发现是使用HttClient来进行响应的操作,起初尝试多次依然不能传递参数和传递文件,后来发现时因为当使用HttpClient时,不能使用request.getParameter()对普通参数进行获取,而要在服务器端使用Upload来进行操作。
HttpClient4.2 jar下载 :http://download.csdn.net/detail/just_szl/4370574
客户端代码:
服务端代码:
http://blog.csdn.net/Just_szl/article/details/7659347
标签:
原文地址:http://www.cnblogs.com/flying607/p/5748385.html