From abf7b1cbf48c8e5197bb43e13da1514ad9a8a86f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=9C=B0=E5=B9=B3=E7=BA=BF?= <22250530@qq.com> Date: Fri, 11 Sep 2015 12:50:47 +0800 Subject: [PATCH] --- src/com/wentch/redkale/util/Utility.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/com/wentch/redkale/util/Utility.java b/src/com/wentch/redkale/util/Utility.java index a00844a3b..7de8ca214 100644 --- a/src/com/wentch/redkale/util/Utility.java +++ b/src/com/wentch/redkale/util/Utility.java @@ -394,6 +394,10 @@ public final class Utility { return remoteHttpContent(null, "POST", url, null, body).toString("UTF-8"); } + public static String postHttpContent(String url, Map headers, String body) throws IOException { + return remoteHttpContent(null, "POST", url, headers, body).toString("UTF-8"); + } + public static String postHttpContent(SSLContext ctx, String url) throws IOException { return remoteHttpContent(ctx, "POST", url, null, null).toString("UTF-8"); } @@ -414,6 +418,10 @@ public final class Utility { return remoteHttpContent(ctx, "POST", url, null, null).toByteArray(); } + public static byte[] postHttpBytesContent(String url, Map headers, String body) throws IOException { + return remoteHttpContent(null, "POST", url, headers, body).toByteArray(); + } + public static byte[] postHttpBytesContent(SSLContext ctx, String url, Map headers, String body) throws IOException { return remoteHttpContent(ctx, "POST", url, headers, body).toByteArray(); } @@ -430,6 +438,10 @@ public final class Utility { return remoteHttpContent(ctx, "GET", url, headers, body).toString("UTF-8"); } + public static String getHttpContent(String url, Map headers, String body) throws IOException { + return remoteHttpContent(null, "GET", url, headers, body).toString("UTF-8"); + } + public static byte[] getHttpBytesContent(String url) throws IOException { return remoteHttpContent(null, "GET", url, null, null).toByteArray(); } @@ -438,6 +450,10 @@ public final class Utility { return remoteHttpContent(ctx, "GET", url, null, null).toByteArray(); } + public static byte[] getHttpBytesContent(String url, Map headers, String body) throws IOException { + return remoteHttpContent(null, "GET", url, headers, body).toByteArray(); + } + public static byte[] getHttpBytesContent(SSLContext ctx, String url, Map headers, String body) throws IOException { return remoteHttpContent(ctx, "GET", url, headers, body).toByteArray(); }