From 0a0d0937e0b6cd805b5dbc09dd75f3bfa34330ba Mon Sep 17 00:00:00 2001 From: Looly Date: Wed, 13 Apr 2022 17:12:54 +0800 Subject: [PATCH] add method --- .../src/main/java/cn/hutool/http/HttpRequest.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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 c7c7df8e8..0d882d7db 100644 --- a/hutool-http/src/main/java/cn/hutool/http/HttpRequest.java +++ b/hutool-http/src/main/java/cn/hutool/http/HttpRequest.java @@ -153,7 +153,18 @@ public class HttpRequest extends HttpBase { * @since 5.7.18 */ public static HttpRequest of(String url, Charset charset) { - return new HttpRequest(UrlBuilder.ofHttp(url, charset)); + return of(UrlBuilder.ofHttp(url, charset)); + } + + /** + * 构建一个HTTP请求
+ * + * @param url {@link UrlBuilder} + * @return HttpRequest + * @since 5.8.0 + */ + public static HttpRequest of(UrlBuilder url) { + return new HttpRequest(url); } /**