Package com.inrupt.client.httpclient
Class HttpClientService
java.lang.Object
com.inrupt.client.httpclient.HttpClientService
- All Implemented Interfaces:
HttpService
A
HttpService
using the java.net.http.HttpClient
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic HttpClientService
ofHttpClient
(HttpClient client) Create an HTTP client service with a pre-configuredHttpClient
.<T> CompletionStage<Response<T>>
send
(Request request, Response.BodyHandler<T> handler) Perform an asynchonous HTTP request.
-
Constructor Details
-
HttpClientService
public HttpClientService()Create an HTTP client service with a defaultHttpClient
.
-
-
Method Details
-
send
Description copied from interface:HttpService
Perform an asynchonous HTTP request.- Specified by:
send
in interfaceHttpService
- Type Parameters:
T
- the response type- Parameters:
request
- the requesthandler
- the response body handler- Returns:
- the next stage of completion, containing the response
-
ofHttpClient
Create an HTTP client service with a pre-configuredHttpClient
.- Parameters:
client
- the HttpClient- Returns:
- an HTTP client service
-