diff --git a/CHANGELOG.md b/CHANGELOG.md index 45a8e5993..1bc5ea2e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ * 【core 】 Sftp增加syncUpload方法(pr#375@Gitee) * 【core 】 改进NetUtil.getLocalHost逻辑(issue#1717@Github) * 【core 】 UseragentUtil增加QQ、alipay、taobao、uc等浏览器识别支持(issue#1719@Github) +* 【http 】 HttpRequest.form方法判断集合增强(pr#381@Gitee) ### 🐞Bug修复 * 【core 】 修复RobotUtil双击右键问题(pr#1721@Github) diff --git a/hutool-http/src/main/java/cn/hutool/http/HttpRequest.java b/hutool-http/src/main/java/cn/hutool/http/HttpRequest.java index 217636047..33c398723 100644 --- a/hutool-http/src/main/java/cn/hutool/http/HttpRequest.java +++ b/hutool-http/src/main/java/cn/hutool/http/HttpRequest.java @@ -493,9 +493,9 @@ public class HttpRequest extends HttpBase { // 普通值 String strValue; - if (value instanceof List) { + if (value instanceof Iterable) { // 列表对象 - strValue = CollUtil.join((List) value, ","); + strValue = CollUtil.join((Iterable) value, ","); } else if (ArrayUtil.isArray(value)) { if (File.class == ArrayUtil.getComponentType(value)) { // 多文件