Package kong.unirest.java
Class JavaClient
- java.lang.Object
-
- kong.unirest.java.JavaClient
-
-
Constructor Summary
Constructors Constructor Description JavaClient(Config config)
JavaClient(Config config, HttpClient client)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
getClient()
<T> HttpResponse<T>
request(HttpRequest request, Function<RawResponse,HttpResponse<T>> transformer)
Make a request<T> CompletableFuture<HttpResponse<T>>
request(HttpRequest request, Function<RawResponse,HttpResponse<T>> transformer, CompletableFuture<HttpResponse<T>> callback, Class<?> resultType)
Make a Async requestprotected <T> HttpResponse<T>
transformBody(Function<RawResponse,HttpResponse<T>> transformer, RawResponse rr)
-
-
-
Constructor Detail
-
JavaClient
public JavaClient(Config config)
-
JavaClient
public JavaClient(Config config, HttpClient client)
-
-
Method Detail
-
getClient
public Object getClient()
-
request
public <T> HttpResponse<T> request(HttpRequest request, Function<RawResponse,HttpResponse<T>> transformer)
Description copied from interface:Client
Make a request
-
request
public <T> CompletableFuture<HttpResponse<T>> request(HttpRequest request, Function<RawResponse,HttpResponse<T>> transformer, CompletableFuture<HttpResponse<T>> callback, Class<?> resultType)
Description copied from interface:Client
Make a Async request- Specified by:
request
in interfaceClient
- 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
-
transformBody
protected <T> HttpResponse<T> transformBody(Function<RawResponse,HttpResponse<T>> transformer, RawResponse rr)
-
-