public class Client extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Client.Builder |
| Modifier and Type | Method and Description |
|---|---|
static Client.Builder |
builder() |
HttpProvider.HttpRequestAuthorizer |
getClientAuthorizer() |
<T,U> T |
sendMessage(HttpProvider.HttpRequest httpRequest,
Class<T> responseClass,
Class<U> errorResponseClass,
BiFunction<Integer,U,RuntimeException> newExceptionFunction)
Sends the requested HTTP Message to the Server.
|
<R,T,U> T |
sendMessage(String method,
String url,
R request,
Class<T> responseClass,
Class<U> errorResponseClass,
BiFunction<Integer,U,RuntimeException> newExceptionFunction)
Sends the requested HTTP Message to the Server.
|
<R,T,U> T |
sendMessage(String method,
String url,
R request,
Map<String,String> additionalHeaders,
Class<T> responseClass,
Class<U> errorResponseClass,
BiFunction<Integer,U,RuntimeException> newExceptionFunction)
Sends the requested HTTP Message to the Server, with additional headers.
|
public static Client.Builder builder()
public HttpProvider.HttpRequestAuthorizer getClientAuthorizer()
public <R,T,U> T sendMessage(String method, String url, R request, Class<T> responseClass, Class<U> errorResponseClass, BiFunction<Integer,U,RuntimeException> newExceptionFunction) throws RequestExecutionException, ResponseParsingException
R - the Request parameterized typeT - the Response parameterized typeU - the Response Error parameterized typemethod - the HTTP methodurl - the HTTP request URLrequest - the request object of type R, or null if no request objectresponseClass - the response object class, for deserializationerrorResponseClass - the response error object class, for deserializationnewExceptionFunction - the function for getting a new RuntimeException based
on the statusCode and error response objectRequestExecutionException - if trouble executing the requestResponseParsingException - if trouble serializing the request,
or deserializing the responsepublic <R,T,U> T sendMessage(String method, String url, R request, Map<String,String> additionalHeaders, Class<T> responseClass, Class<U> errorResponseClass, BiFunction<Integer,U,RuntimeException> newExceptionFunction) throws RequestExecutionException, ResponseParsingException
R - the Request parameterized typeT - the Response parameterized typeU - the Response Error parameterized typemethod - the HTTP methodurl - the HTTP request URLrequest - the request object of type R, or null if no request objectadditionalHeaders - additional headers to add to the request,
beyond that (those) possibly added by your HttpRequestAuthorizer.responseClass - the response object class, for deserializationerrorResponseClass - the response error object class, for deserializationnewExceptionFunction - the function for getting a new RuntimeException based
on the statusCode and error response objectRequestExecutionException - if trouble executing the requestResponseParsingException - if trouble serializing the request,
or deserializing the responsepublic <T,U> T sendMessage(HttpProvider.HttpRequest httpRequest, Class<T> responseClass, Class<U> errorResponseClass, BiFunction<Integer,U,RuntimeException> newExceptionFunction) throws RequestExecutionException, ResponseParsingException
T - the Response parameterized typeU - the Response Error parameterized typehttpRequest - the HTTP RequestresponseClass - the Response classerrorResponseClass - the class for Error ResponsesnewExceptionFunction - the new RuntimeException-creating function
that takes a statusCode and an Error Response object.RequestExecutionException - if trouble executing the requestResponseParsingException - if trouble serializing the request,
or deserializing the responseCopyright © 2022 HERE Europe B.V. All Rights Reserved.