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 Response
    static java.net.http.HttpResponse<java.io.InputStream> getAsyncResponseInputStream​(java.net.http.HttpRequest req, java.net.InetSocketAddress proxy)
    Get Async InputStream Response
    static java.net.http.HttpResponse<java.lang.String> getAsyncResponseString​(java.net.http.HttpRequest req, java.net.InetSocketAddress proxy)
    Get Async String Response

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • getAsyncResponseString

      public static java.net.http.HttpResponse<java.lang.String> getAsyncResponseString​(java.net.http.HttpRequest req, java.net.InetSocketAddress proxy) throws HttpClientException
      Get Async String Response
      Parameters:
      req - HttpRequest object
      proxy - 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 HttpClientException
      Get Async byte array Response
      Parameters:
      req - HttpRequest object
      proxy - 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 HttpClientException
      Get Async InputStream Response
      Parameters:
      req - HttpRequest object
      proxy - Not null is enable proxy
      Returns:
      Exception is NULL
      Throws:
      HttpClientException - get async response exception