diff --git a/pom.xml b/pom.xml index baebdc7e..0ab5c207 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ io.github.lunasaw luna-common luna-common - 2.4.2 + 2.4.3 common is project which contains common utils https://github.com/lunasaw/luna-common diff --git a/src/main/java/com/luna/common/net/HttpUtils.java b/src/main/java/com/luna/common/net/HttpUtils.java index 9cb9a4f0..1b94a8ba 100644 --- a/src/main/java/com/luna/common/net/HttpUtils.java +++ b/src/main/java/com/luna/common/net/HttpUtils.java @@ -70,7 +70,7 @@ */ public class HttpUtils { - public static final HttpClientContext CLIENT_CONTEXT = HttpClientContext.create(); + public static final HttpClientContext CLIENT_CONTEXT = HttpClientContext.create(); private static final int MAX_REDIRECTS = 10; private static CloseableHttpClient httpClient; @@ -571,7 +571,7 @@ public static String buildUrl(String host, String path, Map queries) { * @param httpResponse 响应体 * @return String */ - public static String checkResponseAndGetResult(ClassicHttpResponse httpResponse, boolean isEnsure) { + public static String checkResponseAndGetResultV2(ClassicHttpResponse httpResponse, boolean isEnsure) { if (httpResponse == null) { throw new RuntimeException(); } @@ -708,4 +708,8 @@ public static String checkResponseAndGetResult(ClassicHttpResponse httpResponse) public static String checkResponseAndGetResult(HttpResponse httpResponse) { return checkResponseAndGetResult((ClassicHttpResponse)httpResponse, ImmutableList.of(HttpStatus.SC_OK)); } + + public static String checkResponseAndGetResult(HttpResponse httpResponse, Boolean isEnsure) { + return checkResponseAndGetResultV2((ClassicHttpResponse) httpResponse, isEnsure); + } }