21,886
社区成员
发帖
与我相关
我的任务
分享
entity.setCharset(Consts.UTF_8).setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
for (Map.Entry<String, File> entry : fileMap.entrySet()) {
FileBody fileBody = new FileBody(entry.getValue());
entity.addPart(entry.getKey(), fileBody);
}
for (Map.Entry<String, String> entry : paramMap.entrySet()) {
entity.addTextBody(entry.getKey(), entry.getValue(),ContentType.create("application/x-www-form-urlencoded", Consts.UTF_8));
}
httpPost.setEntity(entity.build());
String result = HttpUtils.exctueRequest(httpPost);