Class HttpClientService

java.lang.Object
com.inrupt.client.httpclient.HttpClientService
All Implemented Interfaces:
HttpService

public class HttpClientService extends Object implements HttpService
A HttpService using the java.net.http.HttpClient.
  • Constructor Details

    • HttpClientService

      public HttpClientService()
      Create an HTTP client service with a default HttpClient.
  • Method Details

    • send

      public <T> CompletionStage<Response<T>> send(Request request, Response.BodyHandler<T> handler)
      Description copied from interface: HttpService
      Perform an asynchonous HTTP request.
      Specified by:
      send in interface HttpService
      Type Parameters:
      T - the response type
      Parameters:
      request - the request
      handler - the response body handler
      Returns:
      the next stage of completion, containing the response
    • ofHttpClient

      public static HttpClientService ofHttpClient(HttpClient client)
      Create an HTTP client service with a pre-configured HttpClient.
      Parameters:
      client - the HttpClient
      Returns:
      an HTTP client service