diff --git a/hutool-http/src/main/java/cn/hutool/v7/http/client/HttpDownloader.java b/hutool-http/src/main/java/cn/hutool/v7/http/client/HttpDownloader.java index 77a09b3658..9f9b802dfd 100644 --- a/hutool-http/src/main/java/cn/hutool/v7/http/client/HttpDownloader.java +++ b/hutool-http/src/main/java/cn/hutool/v7/http/client/HttpDownloader.java @@ -45,6 +45,18 @@ import java.util.Map; */ public class HttpDownloader { + /** + * 创建下载器,使用自定义引擎
+ * 自定义引擎使用完毕后不会关闭 + * + * @param engine 引擎 + * @param url 请求地址 + * @return 下载器 + */ + public static HttpDownloader of(ClientEngine engine, String url) { + return of(url).setEngine(engine).setCloseEngine(false); + } + /** * 创建下载器 *