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(); }