Package org.seppiko.commons.utils.http
Class AsyncHttpClientUtil
java.lang.Object
org.seppiko.commons.utils.http.AsyncHttpClientUtil
public class AsyncHttpClientUtil
extends java.lang.Object
Http Async Response Util with java.net.http
HttpRequest see
HttpClientUtil- Author:
- Leonard Woo
-
Constructor Summary
Constructors Constructor Description AsyncHttpClientUtil() -
Method Summary
Modifier and Type Method Description static java.net.http.HttpResponse<byte[]>getAsyncResponseByteArray(java.net.http.HttpRequest req, java.net.InetSocketAddress proxy)Get Async byte array Responsestatic java.net.http.HttpResponse<java.io.InputStream>getAsyncResponseInputStream(java.net.http.HttpRequest req, java.net.InetSocketAddress proxy)Get Async InputStream Responsestatic java.net.http.HttpResponse<java.lang.String>getAsyncResponseString(java.net.http.HttpRequest req, java.net.InetSocketAddress proxy)Get Async String ResponseMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
AsyncHttpClientUtil
public AsyncHttpClientUtil()
-
-
Method Details
-
getAsyncResponseString
public static java.net.http.HttpResponse<java.lang.String> getAsyncResponseString(java.net.http.HttpRequest req, java.net.InetSocketAddress proxy) throws HttpClientExceptionGet Async String Response- Parameters:
req- HttpRequest objectproxy- Not null is enable proxy- Returns:
- Exception is NULL
- Throws:
HttpClientException- get async response exception
-
getAsyncResponseByteArray
public static java.net.http.HttpResponse<byte[]> getAsyncResponseByteArray(java.net.http.HttpRequest req, java.net.InetSocketAddress proxy) throws HttpClientExceptionGet Async byte array Response- Parameters:
req- HttpRequest objectproxy- Not null is enable proxy- Returns:
- Exception is NULL
- Throws:
HttpClientException- get async response exception
-
getAsyncResponseInputStream
public static java.net.http.HttpResponse<java.io.InputStream> getAsyncResponseInputStream(java.net.http.HttpRequest req, java.net.InetSocketAddress proxy) throws HttpClientExceptionGet Async InputStream Response- Parameters:
req- HttpRequest objectproxy- Not null is enable proxy- Returns:
- Exception is NULL
- Throws:
HttpClientException- get async response exception
-