【发布时间】:2019-05-22 01:30:56
【问题描述】:
如何使用 jodd HTTP 在同一个请求中上传多个文件?
我尝试了类似以下的方法,但只发布了第一个文件。
HttpRequest httpRequest = HttpRequest
.post("http://srv:8080/api/dlapp/add-file-entry")
.form(
"title", "test",
"description", "Upload test",
"file", new File("d:\\a.jpg.zip"),
"file", new File("d:\\b.jpg.zip")
);
HttpResponse httpResponse = httpRequest.send();
【问题讨论】:
-
您是否尝试过使用不同的参数名称
file,例如file1和file2? -
@igr 是的,试过
file1,file2同样的效果,只有第一个文件被上传了
标签: jodd