Interface Client
- All Known Implementing Classes:
JavaClient
public interface Client
The client that does the work.
-
Method Summary
Modifier and TypeMethodDescription<T> T<T> HttpResponse<T> request(HttpRequest request, Function<RawResponse, HttpResponse<T>> transformer, Class<?> resultType) Make a request<T> CompletableFuture<HttpResponse<T>> request(HttpRequest request, Function<RawResponse, HttpResponse<T>> transformer, CompletableFuture<HttpResponse<T>> callback, Class<?> resultType) Make a Async requestsse(SseRequest request) sse(SseRequest request, SseHandler handler) execute a SSE Event connection.websocket(WebSocketRequest request, WebSocket.Listener listener) Create a websocket connection
-
Method Details
-
getClient
<T> T getClient()- Type Parameters:
T- the underlying client- Returns:
- the underlying client if this instance is wrapping another library.
-
request
<T> HttpResponse<T> request(HttpRequest request, Function<RawResponse, HttpResponse<T>> transformer, Class<?> resultType) Make a request- Type Parameters:
T- The type of the body- Parameters:
request- the prepared request objecttransformer- the function to transform the responseresultType- the final body result type. This is a hint to downstream systems to make up for type erasure.- Returns:
- a HttpResponse with a transformed body
-
request
<T> CompletableFuture<HttpResponse<T>> request(HttpRequest request, Function<RawResponse, HttpResponse<T>> transformer, CompletableFuture<HttpResponse<T>> callback, Class<?> resultType) Make a Async request- Type Parameters:
T- The type of the body- Parameters:
request- the prepared request objecttransformer- the function to transform the responsecallback- the CompletableFuture that will handle the eventual responseresultType- the final body result type. This is a hint to downstream systems to make up for type erasure.- Returns:
- a CompletableFuture of a response
-
websocket
Create a websocket connection- Parameters:
request- the connectionlistener- (in the voice of Cicero) the listener- Returns:
- a WebSocketResponse
-
sse
execute a SSE Event connection. Because these events are a stream they are processed async and take a handler you can use to consume the events- Parameters:
request- the request detailshandler- the SseHandler- Returns:
- a CompletableFuture
-
sse
-