From 6baac9cdc9f7f79160c60e9ae0162c561005f449 Mon Sep 17 00:00:00 2001 From: zhang <zc857179121@qq.com> Date: 星期四, 21 八月 2025 13:58:03 +0800 Subject: [PATCH] 1 --- src/main/java/com/zy/common/utils/HttpHandler.java | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/zy/common/utils/HttpHandler.java b/src/main/java/com/zy/common/utils/HttpHandler.java index 70adcc7..809a1cd 100644 --- a/src/main/java/com/zy/common/utils/HttpHandler.java +++ b/src/main/java/com/zy/common/utils/HttpHandler.java @@ -52,7 +52,9 @@ } Request request = headerBuilder.url(url).build(); Response response = getClient(timeout, timeUnit).newCall(request).execute(); - return response.isSuccessful() ? response.body().string() : null; + String result = response.isSuccessful() ? response.body().string() : null; + response.close(); + return result; } /** @@ -86,8 +88,9 @@ } Call call = getClient(timeout, timeUnit).newCall(request); Response response = call.execute(); - return response.body().string(); - + String result = response.body().string(); + response.close(); + return result; } /** -- Gitblit v1.9.1