| Package | Description |
|---|---|
| kong.unirest | |
| kong.unirest.apache |
| Modifier and Type | Class and Description |
|---|---|
class |
BasicResponse<T> |
class |
ByteResponse |
class |
FileResponse |
class |
JsonResponse |
class |
StringResponse |
| Modifier and Type | Method and Description |
|---|---|
HttpResponse<byte[]> |
HttpRequest.asBytes()
Executes the request and returns the response with the body mapped into a byte[]
|
HttpResponse |
HttpRequest.asEmpty()
Executes the request and returns the response without parsing the body
|
HttpResponse<File> |
HttpRequest.asFile(String path)
Executes the request and writes the contents into a file
|
HttpResponse<JsonNode> |
HttpRequest.asJson()
Executes the request and returns the response with the body mapped into a JsonNode
|
<T> HttpResponse<T> |
HttpRequest.asObject(Class<? extends T> responseClass)
Executes the request and returns the response with the body mapped into T by a configured ObjectMapper
|
<T> HttpResponse<T> |
HttpRequest.asObject(java.util.function.Function<RawResponse,T> function)
Execute the request and pass the raw response to a function for mapping.
|
<T> HttpResponse<T> |
HttpRequest.asObject(GenericType<T> genericType)
Executes the request and returns the response with the body mapped into T by a configured ObjectMapper
|
HttpResponse<String> |
HttpRequest.asString()
Executes the request and returns the response with the body mapped into a String
|
<E> HttpResponse<T> |
HttpResponse.ifFailure(Class<? extends E> errorClass,
java.util.function.Consumer<HttpResponse<E>> consumer)
If the response was NOT a 200-series response or a mapping exception happened.
|
HttpResponse<T> |
HttpResponse.ifFailure(java.util.function.Consumer<HttpResponse<T>> consumer)
If the response was NOT a 200-series response or a mapping exception happened.
|
HttpResponse<T> |
HttpResponse.ifSuccess(java.util.function.Consumer<HttpResponse<T>> consumer)
If the response was a 200-series response.
|
<V> HttpResponse<V> |
HttpResponse.map(java.util.function.Function<T,V> func)
Map the Response into another response with a different body
|
<T> HttpResponse<T> |
Client.request(HttpRequest request,
java.util.function.Function<RawResponse,HttpResponse<T>> transformer)
Make a request
|
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<HttpResponse<byte[]>> |
HttpRequest.asBytesAsync()
Executes the request asynchronously and returns the response with the body mapped into a byte[]
|
CompletableFuture<HttpResponse<byte[]>> |
HttpRequest.asBytesAsync(Callback<byte[]> callback)
Executes the request asynchronously and returns the response with the body mapped into a byte[]
|
CompletableFuture<HttpResponse<Empty>> |
HttpRequest.asEmptyAsync()
Executes the request asynchronously and returns the response without parsing the body
|
CompletableFuture<HttpResponse<Empty>> |
HttpRequest.asEmptyAsync(Callback<Empty> callback)
Executes the request asynchronously and returns a empty response which is passed to a callback
|
CompletableFuture<HttpResponse<File>> |
HttpRequest.asFileAsync(String path)
asynchronously executes the request and writes the contents into a file
|
CompletableFuture<HttpResponse<File>> |
HttpRequest.asFileAsync(String path,
Callback<File> callback)
asynchronously executes the request and writes the contents into a file
|
CompletableFuture<HttpResponse<JsonNode>> |
HttpRequest.asJsonAsync()
Executes the request asynchronously and returns the response with the body mapped into a JsonNode
|
CompletableFuture<HttpResponse<JsonNode>> |
HttpRequest.asJsonAsync(Callback<JsonNode> callback)
Executes the request asynchronously and returns the response with the body mapped into a JsonNode
|
<T> CompletableFuture<HttpResponse<T>> |
HttpRequest.asObjectAsync(Class<? extends T> responseClass)
Executes the request asynchronously and returns response with the body mapped into T by a configured ObjectMapper
|
<T> CompletableFuture<HttpResponse<T>> |
HttpRequest.asObjectAsync(Class<? extends T> responseClass,
Callback<T> callback)
Executes the request asynchronously, mapping to a type via the configured object mapper and then passed to a callback handler.
|
<T> CompletableFuture<HttpResponse<T>> |
HttpRequest.asObjectAsync(java.util.function.Function<RawResponse,T> function)
Executes the request asynchronously, and pass the raw response to a function for mapping.
|
<T> CompletableFuture<HttpResponse<T>> |
HttpRequest.asObjectAsync(GenericType<T> genericType)
Executes the request asynchronously, and use a GenericType with the ObjectMapper
|
<T> CompletableFuture<HttpResponse<T>> |
HttpRequest.asObjectAsync(GenericType<T> genericType,
Callback<T> callback)
Executes the request asynchronously, and use a GenericType with the ObjectMapper
|
CompletableFuture<HttpResponse<String>> |
HttpRequest.asStringAsync()
Executes the request asynchronously and returns the response with the body mapped into a String
|
CompletableFuture<HttpResponse<String>> |
HttpRequest.asStringAsync(Callback<String> callback)
Executes the request asynchronously and returns the response with the body mapped into a String
|
java.util.function.Consumer<HttpResponse<?>> |
Config.getErrorHandler() |
<T> CompletableFuture<HttpResponse<T>> |
AsyncClient.request(HttpRequest request,
java.util.function.Function<RawResponse,HttpResponse<T>> transformer,
CompletableFuture<HttpResponse<T>> callback)
Make a Async request
|
| Modifier and Type | Method and Description |
|---|---|
void |
Callback.completed(HttpResponse<T> response) |
| Modifier and Type | Method and Description |
|---|---|
<T> PagedList<T> |
HttpRequest.asPaged(java.util.function.Function<HttpRequest,HttpResponse> mappingFunction,
java.util.function.Function<HttpResponse<T>,String> linkExtractor)
Allows for following paging links common in many APIs.
|
<T> PagedList<T> |
HttpRequest.asPaged(java.util.function.Function<HttpRequest,HttpResponse> mappingFunction,
java.util.function.Function<HttpResponse<T>,String> linkExtractor)
Allows for following paging links common in many APIs.
|
Config |
Config.errorHandler(java.util.function.Consumer<HttpResponse<?>> consumer)
Sets a global error handler
If the response was NOT a 200-series response or a mapping exception happened.
|
<E> HttpResponse<T> |
HttpResponse.ifFailure(Class<? extends E> errorClass,
java.util.function.Consumer<HttpResponse<E>> consumer)
If the response was NOT a 200-series response or a mapping exception happened.
|
PagedList<T> |
PagedList.ifFailure(java.util.function.Consumer<HttpResponse<T>> consumer)
For each failed response if the response was NOT a 200-series response or a mapping exception happened.
|
HttpResponse<T> |
HttpResponse.ifFailure(java.util.function.Consumer<HttpResponse<T>> consumer)
If the response was NOT a 200-series response or a mapping exception happened.
|
PagedList<T> |
PagedList.ifSuccess(java.util.function.Consumer<HttpResponse<T>> consumer)
For each successful response If the response was a 200-series response.
|
HttpResponse<T> |
HttpResponse.ifSuccess(java.util.function.Consumer<HttpResponse<T>> consumer)
If the response was a 200-series response.
|
<T> HttpResponse<T> |
Client.request(HttpRequest request,
java.util.function.Function<RawResponse,HttpResponse<T>> transformer)
Make a request
|
<T> CompletableFuture<HttpResponse<T>> |
AsyncClient.request(HttpRequest request,
java.util.function.Function<RawResponse,HttpResponse<T>> transformer,
CompletableFuture<HttpResponse<T>> callback)
Make a Async request
|
<T> CompletableFuture<HttpResponse<T>> |
AsyncClient.request(HttpRequest request,
java.util.function.Function<RawResponse,HttpResponse<T>> transformer,
CompletableFuture<HttpResponse<T>> callback)
Make a Async request
|
| Modifier and Type | Method and Description |
|---|---|
<T> HttpResponse<T> |
ApacheClient.request(HttpRequest request,
java.util.function.Function<RawResponse,HttpResponse<T>> transformer) |
| Modifier and Type | Method and Description |
|---|---|
<T> CompletableFuture<HttpResponse<T>> |
ApacheAsyncClient.request(HttpRequest request,
java.util.function.Function<RawResponse,HttpResponse<T>> transformer,
CompletableFuture<HttpResponse<T>> callback) |
| Modifier and Type | Method and Description |
|---|---|
<T> HttpResponse<T> |
ApacheClient.request(HttpRequest request,
java.util.function.Function<RawResponse,HttpResponse<T>> transformer) |
<T> CompletableFuture<HttpResponse<T>> |
ApacheAsyncClient.request(HttpRequest request,
java.util.function.Function<RawResponse,HttpResponse<T>> transformer,
CompletableFuture<HttpResponse<T>> callback) |
<T> CompletableFuture<HttpResponse<T>> |
ApacheAsyncClient.request(HttpRequest request,
java.util.function.Function<RawResponse,HttpResponse<T>> transformer,
CompletableFuture<HttpResponse<T>> callback) |
Copyright © 2019. All rights reserved.