From dfb800473ab424dc475e774c8c8e6f7e98fdb80c Mon Sep 17 00:00:00 2001 From: Redkale <8730487+redkale@users.noreply.github.com> Date: Sat, 4 Aug 2018 18:08:11 +0800 Subject: [PATCH] --- src/org/redkale/util/Utility.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/org/redkale/util/Utility.java b/src/org/redkale/util/Utility.java index c30332edf..6e1f37a1c 100644 --- a/src/org/redkale/util/Utility.java +++ b/src/org/redkale/util/Utility.java @@ -391,7 +391,7 @@ public final class Utility { } return sb.toString(); } - + /** * 将int数组用分隔符拼接成字符串 * @@ -616,7 +616,7 @@ public final class Utility { } return false; } - + /** * 判断指定值是否包含指定的数组中,包含返回true * @@ -1742,10 +1742,10 @@ public final class Utility { conn.setRequestProperty(en.getKey(), en.getValue()); } } - if (body != null) { + { conn.setDoInput(true); conn.setDoOutput(true); - conn.getOutputStream().write(body.getBytes(UTF_8)); + conn.getOutputStream().write(body == null ? new byte[0] : body.getBytes(UTF_8)); } conn.connect(); int rs = conn.getResponseCode();