public class RestClient extends Object implements Closeable
| Constructor and Description |
|---|
RestClient(org.everit.http.client.HttpClient httpClient,
JSONObjectMapper objectMapper) |
| Modifier and Type | Method and Description |
|---|---|
io.reactivex.Completable |
callEndpoint(RestRequest restRequest,
Optional<RestRequestEnhancer> requestEnhancer)
Calls a rest endpoint asynchronously where there is no response body.
|
<T> io.reactivex.Single<T> |
callEndpoint(RestRequest restRequest,
Optional<RestRequestEnhancer> requestEnhancer,
TypeReference<T> returnType)
Calls a rest endpoint asynchronously.
|
void |
close() |
JSONObjectMapper |
getObjectMapper() |
public RestClient(org.everit.http.client.HttpClient httpClient,
JSONObjectMapper objectMapper)
public io.reactivex.Completable callEndpoint(RestRequest restRequest, Optional<RestRequestEnhancer> requestEnhancer)
restRequest - The request that is used to call the endpoint.requestEnhancer - If specified, it is used to enhance the rest request before sending it.public <T> io.reactivex.Single<T> callEndpoint(RestRequest restRequest, Optional<RestRequestEnhancer> requestEnhancer, TypeReference<T> returnType)
T - Type of the response body.restRequest - The request that is used to call the endpoint.requestEnhancer - If specified, it is used to enhance the rest request before sending it.returnType - Type of the response body, Jackson is used to convert it from JSON to a typed java
object.public void close()
close in interface Closeableclose in interface AutoCloseablepublic JSONObjectMapper getObjectMapper()
Copyright © 2011–2019 Everit Kft.. All rights reserved.