客户端:Part[] parts = { new StringPart("id", "aaa") };
post.setRequestEntity(new MultipartRequestEntity(parts, post
.getParams()));
client.executeMethod(post);
我想知道服务端怎么接收这个parts 是用request吗?如果是又是怎么做到的?
post.setRequestEntity(new MultipartRequestEntity(parts, post
.getParams()));
client.executeMethod(post);
我想知道服务端怎么接收这个parts 是用request吗?如果是又是怎么做到的?
解决方案 »
- 网站每天出现错误,但刷新一下就好正常了
- 小弟崩溃了,求各位大神拯救
- java.lang.IllegalArgumentException: Width (0) and height (0) cannot be <= 0
- snmp4j如何获得集线器的mib库
- 各位大哥,有谁懂Spring,帮我看看!!
- 请高手指教JSP 内存溢出问题
- 在jsp中如何使用一个按钮来删除你所选中的数据
- 初学JavaBeans,100分帮我解释这些数据库链接代码,每行都需要有解读,谢谢!
- 为什么我得 JBuilder8 不能对 JSP 文件保存??急
- jsp乱码问题
- 关于【社交网络】里扎克伯格做的关于给女生相片打分的实现原理
- 我新建了一个servlet,可是运行不起
HttpClient client = new HttpClient();
PostMethod post = new PostMethod(
"http://admin-pc:8080/8-8-PLAT/data/selectNode.json");
post.getParams().setParameter(HttpMethodParams.HTTP_CONTENT_CHARSET,
"utf-8");
post.setRequestHeader("Content-Type", "application/json");
Part[] parts = { new StringPart("id", "aaa") };
post.setRequestEntity(new MultipartRequestEntity(parts, post
.getParams()));
// 发送请求
client.executeMethod(post);
// 获取服务端返回的json值
String response = post.getResponseBodyAsString();