From 5c0b206f33d9b0dad7cff1d0fbc26c8e1ea685bf Mon Sep 17 00:00:00 2001 From: xuxueli <931591021@qq.com> Date: Fri, 14 Jul 2017 16:59:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E8=B0=83Http=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E7=A0=81=E5=BC=82=E5=B8=B8=E6=97=B6=EF=BC=8C=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E5=93=8D=E5=BA=94=E6=B6=88=E6=81=AF=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/xxl/job/core/util/AdminApiUtil.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xxl-job-core/src/main/java/com/xxl/job/core/util/AdminApiUtil.java b/xxl-job-core/src/main/java/com/xxl/job/core/util/AdminApiUtil.java index 7f887873..eddb1018 100644 --- a/xxl-job-core/src/main/java/com/xxl/job/core/util/AdminApiUtil.java +++ b/xxl-job-core/src/main/java/com/xxl/job/core/util/AdminApiUtil.java @@ -95,12 +95,13 @@ public class AdminApiUtil { HttpResponse response = httpClient.execute(httpPost); HttpEntity entity = response.getEntity(); if (null != entity) { + String responseMsg = EntityUtils.toString(entity, "UTF-8"); if (response.getStatusLine().getStatusCode() != 200) { EntityUtils.consume(entity); - return new ReturnT(response.getStatusLine().getStatusCode(), "StatusCode Error."); + return new ReturnT(response.getStatusLine().getStatusCode(), + "StatusCode(+"+ response.getStatusLine().getStatusCode() +") Error,response:" + responseMsg); } - String responseMsg = EntityUtils.toString(entity, "UTF-8"); EntityUtils.consume(entity); if (responseMsg!=null && responseMsg.startsWith("{")) { ReturnT result = JacksonUtil.readValue(responseMsg, ReturnT.class);