Package com.wultra.core.rest.client.base
Class DefaultRestClient
java.lang.Object
com.wultra.core.rest.client.base.DefaultRestClient
- All Implemented Interfaces:
RestClient
Default REST client implementation based on WebClient.
- Author:
- Roman Strobl, roman.strobl@wultra.com
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder used for configuration of the default rest client.static classCertificate authentication builder.static classHTTP basic authentication builder.static classHTTP digest authentication builder.static classProxy builder. -
Constructor Summary
ConstructorsConstructorDescriptionDefaultRestClient(RestClientConfiguration config, com.fasterxml.jackson.databind.Module... modules) Construct default REST client with specified configuration.DefaultRestClient(String baseUrl) Construct default REST client without any additional configuration. -
Method Summary
Modifier and TypeMethodDescriptionstatic DefaultRestClient.Builderbuilder()Construct a new rest client builder.<T> org.springframework.http.ResponseEntity<T> Execute a blocking HTTP DELETE request.<T> org.springframework.http.ResponseEntity<T> delete(String path, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, String> headers, org.springframework.core.ParameterizedTypeReference<T> responseType) Execute a blocking HTTP DELETE request with specified HTTP headers.<T> voiddeleteNonBlocking(String path, org.springframework.core.ParameterizedTypeReference<T> responseType, Consumer<org.springframework.http.ResponseEntity<T>> onSuccess, Consumer<Throwable> onError) Execute a non-blocking HTTP DELETE request.<T> voiddeleteNonBlocking(String path, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, String> headers, org.springframework.core.ParameterizedTypeReference<T> responseType, Consumer<org.springframework.http.ResponseEntity<T>> onSuccess, Consumer<Throwable> onError) Execute a non-blocking HTTP DELETE request with specified HTTP headers.deleteObject(String path) Execute a blocking HTTP DELETE request with ObjectRequest / Response types.<T> ObjectResponse<T> deleteObject(String path, Class<T> responseType) Execute a blocking HTTP DELETE request with ObjectRequest / ObjectResponse types.deleteObject(String path, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, String> headers) Execute a blocking HTTP DELETE request with ObjectRequest / Response types and specified query parameters and HTTP headers.<T> ObjectResponse<T> deleteObject(String path, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, String> headers, Class<T> responseType) Execute a blocking HTTP DELETE request with ObjectRequest / ObjectResponse types and specified query parameters and HTTP headers.<T> org.springframework.http.ResponseEntity<T> Execute a blocking HTTP GET request.<T> org.springframework.http.ResponseEntity<T> get(String path, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, String> headers, org.springframework.core.ParameterizedTypeReference<T> responseType) Execute a blocking HTTP GET request with specified HTTP headers.<T> voidgetNonBlocking(String path, org.springframework.core.ParameterizedTypeReference<T> responseType, Consumer<org.springframework.http.ResponseEntity<T>> onSuccess, Consumer<Throwable> onError) Execute a non-blocking HTTP GET request.<T> voidgetNonBlocking(String path, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, String> headers, org.springframework.core.ParameterizedTypeReference<T> responseType, Consumer<org.springframework.http.ResponseEntity<T>> onSuccess, Consumer<Throwable> onError) Execute a non-blocking HTTP GET request with specified HTTP headers.Execute a blocking HTTP GET request with ObjectRequest / Response types.<T> ObjectResponse<T> Execute a blocking HTTP GET request with ObjectRequest / ObjectResponse types.getObject(String path, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, String> headers) Execute a blocking HTTP GET request with ObjectRequest / Response types and specified query parameters and HTTP headers.<T> ObjectResponse<T> getObject(String path, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, String> headers, Class<T> responseType) Execute a blocking HTTP GET request with ObjectRequest / ObjectResponse types and specified query parameters and HTTP headers.<T> org.springframework.http.ResponseEntity<T> Execute a blocking HTTP HEAD request.<T> org.springframework.http.ResponseEntity<T> head(String path, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, String> headers, org.springframework.core.ParameterizedTypeReference<T> responseType) Execute a blocking HTTP HEAD request with specified HTTP headers.<T> voidheadNonBlocking(String path, org.springframework.core.ParameterizedTypeReference<T> responseType, Consumer<org.springframework.http.ResponseEntity<T>> onSuccess, Consumer<Throwable> onError) Execute a non-blocking HTTP HEAD request.<T> voidheadNonBlocking(String path, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, String> headers, org.springframework.core.ParameterizedTypeReference<T> responseType, Consumer<org.springframework.http.ResponseEntity<T>> onSuccess, Consumer<Throwable> onError) Execute a non-blocking HTTP HEAD request with specified HTTP headers.headObject(String path) Execute a blocking HTTP HEAD request with ObjectRequest / Response types.<T> ObjectResponse<T> headObject(String path, Class<T> responseType) Execute a blocking HTTP HEAD request with ObjectRequest / ObjectResponse types.headObject(String path, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, String> headers) Execute a blocking HTTP HEAD request with ObjectRequest / Response types and specified query parameters and HTTP headers.<T> ObjectResponse<T> headObject(String path, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, String> headers, Class<T> responseType) Execute a blocking HTTP HEAD request with ObjectRequest / ObjectResponse types and specified query parameters and HTTP headers.<T> org.springframework.http.ResponseEntity<T> patch(String path, Object request, org.springframework.core.ParameterizedTypeReference<T> responseType) Execute a blocking HTTP PATCH request.<T> org.springframework.http.ResponseEntity<T> patch(String path, Object request, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, String> headers, org.springframework.core.ParameterizedTypeReference<T> responseType) Execute a blocking HTTP PATCH request with specified HTTP headers.<T> voidpatchNonBlocking(String path, Object request, org.springframework.core.ParameterizedTypeReference<T> responseType, Consumer<org.springframework.http.ResponseEntity<T>> onSuccess, Consumer<Throwable> onError) Execute a non-blocking HTTP PATCH request.<T> voidpatchNonBlocking(String path, Object request, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, String> headers, org.springframework.core.ParameterizedTypeReference<T> responseType, Consumer<org.springframework.http.ResponseEntity<T>> onSuccess, Consumer<Throwable> onError) Execute a non-blocking HTTP PATCH request with specified HTTP headers.patchObject(String path, ObjectRequest<?> objectRequest) Execute a blocking HTTP PATCH request with ObjectRequest / Response types.<T> ObjectResponse<T> patchObject(String path, ObjectRequest<?> objectRequest, Class<T> responseType) Execute a blocking HTTP PATCH request with ObjectRequest / ObjectResponse types.patchObject(String path, ObjectRequest<?> objectRequest, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, String> headers) Execute a blocking HTTP PATCH request with ObjectRequest / Response types and specified query parameters and HTTP headers.<T> ObjectResponse<T> patchObject(String path, ObjectRequest<?> objectRequest, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, String> headers, Class<T> responseType) Execute a blocking HTTP PATCH request with ObjectRequest / ObjectResponse types and specified query parameters and HTTP headers.<T> org.springframework.http.ResponseEntity<T> post(String path, Object request, org.springframework.core.ParameterizedTypeReference<T> responseType) Execute a blocking HTTP POST request.<T> org.springframework.http.ResponseEntity<T> post(String path, Object request, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, String> headers, org.springframework.core.ParameterizedTypeReference<T> responseType) Execute a blocking HTTP POST request with specified HTTP headers.<T> voidpostNonBlocking(String path, Object request, org.springframework.core.ParameterizedTypeReference<T> responseType, Consumer<org.springframework.http.ResponseEntity<T>> onSuccess, Consumer<Throwable> onError) Execute a non-blocking HTTP POST request.<T> voidpostNonBlocking(String path, Object request, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, String> headers, org.springframework.core.ParameterizedTypeReference<T> responseType, Consumer<org.springframework.http.ResponseEntity<T>> onSuccess, Consumer<Throwable> onError) Execute a non-blocking HTTP POST request with specified HTTP headers.postObject(String path, ObjectRequest<?> objectRequest) Execute a blocking HTTP POST request with ObjectRequest / Response types.<T> ObjectResponse<T> postObject(String path, ObjectRequest<?> objectRequest, Class<T> responseType) Execute a blocking HTTP POST request with ObjectRequest / ObjectResponse types.postObject(String path, ObjectRequest<?> objectRequest, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, String> headers) Execute a blocking HTTP POST request with ObjectRequest / Response types and specified query parameters and HTTP headers.<T> ObjectResponse<T> postObject(String path, ObjectRequest<?> objectRequest, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, String> headers, Class<T> responseType) Execute a blocking HTTP POST request with ObjectRequest / ObjectResponse types and specified query parameters and HTTP headers.<T> org.springframework.http.ResponseEntity<T> put(String path, Object request, org.springframework.core.ParameterizedTypeReference<T> responseType) Execute a blocking HTTP PUT request.<T> org.springframework.http.ResponseEntity<T> put(String path, Object request, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, String> headers, org.springframework.core.ParameterizedTypeReference<T> responseType) Execute a blocking HTTP PUT request with specified HTTP headers.<T> voidputNonBlocking(String path, Object request, org.springframework.core.ParameterizedTypeReference<T> responseType, Consumer<org.springframework.http.ResponseEntity<T>> onSuccess, Consumer<Throwable> onError) Execute a non-blocking HTTP PUT request.<T> voidputNonBlocking(String path, Object request, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, String> headers, org.springframework.core.ParameterizedTypeReference<T> responseType, Consumer<org.springframework.http.ResponseEntity<T>> onSuccess, Consumer<Throwable> onError) Execute a non-blocking HTTP PUT request with specified HTTP headers.putObject(String path, ObjectRequest<?> objectRequest) Execute a blocking HTTP PUT request with ObjectRequest / Response types.<T> ObjectResponse<T> putObject(String path, ObjectRequest<?> objectRequest, Class<T> responseType) Execute a blocking HTTP PUT request with ObjectRequest / ObjectResponse types.putObject(String path, ObjectRequest<?> objectRequest, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, String> headers) Execute a blocking HTTP PUT request with ObjectRequest / Response types and specified query parameters and HTTP headers.<T> ObjectResponse<T> putObject(String path, ObjectRequest<?> objectRequest, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, String> headers, Class<T> responseType) Execute a blocking HTTP PUT request with ObjectRequest / ObjectResponse types and specified query parameters and HTTP headers.
-
Constructor Details
-
DefaultRestClient
Construct default REST client without any additional configuration.- Parameters:
baseUrl- Base URL.- Throws:
RestClientException- Thrown in case client initialization fails.
-
DefaultRestClient
public DefaultRestClient(RestClientConfiguration config, com.fasterxml.jackson.databind.Module... modules) throws RestClientException Construct default REST client with specified configuration.- Parameters:
config- REST client configuration.modules- jackson modules- Throws:
RestClientException- Thrown in case client initialization fails.
-
-
Method Details
-
get
public <T> org.springframework.http.ResponseEntity<T> get(String path, org.springframework.core.ParameterizedTypeReference<T> responseType) throws RestClientException Description copied from interface:RestClientExecute a blocking HTTP GET request.- Specified by:
getin interfaceRestClient- Type Parameters:
T- Response type.- Parameters:
path- Request path.responseType- Parameterized response type.- Returns:
- HTTP GET response.
- Throws:
RestClientException- Thrown in case HTTP GET request fails.
-
get
public <T> org.springframework.http.ResponseEntity<T> get(String path, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, throws RestClientExceptionString> headers, org.springframework.core.ParameterizedTypeReference<T> responseType) Description copied from interface:RestClientExecute a blocking HTTP GET request with specified HTTP headers.- Specified by:
getin interfaceRestClient- Type Parameters:
T- Response type.- Parameters:
path- Request path.queryParams- Query parameters.headers- HTTP headers.responseType- Parameterized response type.- Returns:
- HTTP GET response.
- Throws:
RestClientException- Thrown in case HTTP GET request fails.
-
getNonBlocking
public <T> void getNonBlocking(String path, org.springframework.core.ParameterizedTypeReference<T> responseType, Consumer<org.springframework.http.ResponseEntity<T>> onSuccess, Consumer<Throwable> onError) throws RestClientException Description copied from interface:RestClientExecute a non-blocking HTTP GET request.- Specified by:
getNonBlockingin interfaceRestClient- Type Parameters:
T- Response type.- Parameters:
path- Request path.responseType- Parameterized response type.onSuccess- Consumer used in case of success.onError- Consumer used in case of failure.- Throws:
RestClientException- Thrown in case HTTP GET request fails.
-
getNonBlocking
public <T> void getNonBlocking(String path, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, throws RestClientExceptionString> headers, org.springframework.core.ParameterizedTypeReference<T> responseType, Consumer<org.springframework.http.ResponseEntity<T>> onSuccess, Consumer<Throwable> onError) Description copied from interface:RestClientExecute a non-blocking HTTP GET request with specified HTTP headers.- Specified by:
getNonBlockingin interfaceRestClient- Type Parameters:
T- Response type.- Parameters:
path- Request path.queryParams- Query parameters.headers- HTTP headers.responseType- Parameterized response type.onSuccess- Consumer used in case of success.onError- Consumer used in case of failure.- Throws:
RestClientException- Thrown in case HTTP GET request fails.
-
getObject
Description copied from interface:RestClientExecute a blocking HTTP GET request with ObjectRequest / Response types.- Specified by:
getObjectin interfaceRestClient- Parameters:
path- Request path.- Returns:
- Response.
- Throws:
RestClientException- Thrown in case HTTP GET request fails.
-
getObject
public Response getObject(String path, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, throws RestClientExceptionString> headers) Description copied from interface:RestClientExecute a blocking HTTP GET request with ObjectRequest / Response types and specified query parameters and HTTP headers.- Specified by:
getObjectin interfaceRestClient- Parameters:
path- Request path.queryParams- Query parameters.headers- HTTP headers.- Returns:
- Response.
- Throws:
RestClientException- Thrown in case HTTP GET request fails.
-
getObject
public <T> ObjectResponse<T> getObject(String path, Class<T> responseType) throws RestClientException Description copied from interface:RestClientExecute a blocking HTTP GET request with ObjectRequest / ObjectResponse types.- Specified by:
getObjectin interfaceRestClient- Type Parameters:
T- Response type.- Parameters:
path- Request path.responseType- Object response type.- Returns:
- Object response.
- Throws:
RestClientException- Thrown in case HTTP GET request fails.
-
getObject
public <T> ObjectResponse<T> getObject(String path, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, throws RestClientExceptionString> headers, Class<T> responseType) Description copied from interface:RestClientExecute a blocking HTTP GET request with ObjectRequest / ObjectResponse types and specified query parameters and HTTP headers.- Specified by:
getObjectin interfaceRestClient- Type Parameters:
T- Response type.- Parameters:
path- Request path.queryParams- Query parameters.headers- HTTP headers.responseType- Object response type.- Returns:
- Object response.
- Throws:
RestClientException- Thrown in case HTTP GET request fails.
-
post
public <T> org.springframework.http.ResponseEntity<T> post(String path, Object request, org.springframework.core.ParameterizedTypeReference<T> responseType) throws RestClientException Description copied from interface:RestClientExecute a blocking HTTP POST request.- Specified by:
postin interfaceRestClient- Type Parameters:
T- Response type.- Parameters:
path- Request path.request- Request object.responseType- Parameterized response type.- Returns:
- HTTP POST response.
- Throws:
RestClientException- Thrown in case HTTP POST request fails.
-
post
public <T> org.springframework.http.ResponseEntity<T> post(String path, Object request, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, throws RestClientExceptionString> headers, org.springframework.core.ParameterizedTypeReference<T> responseType) Description copied from interface:RestClientExecute a blocking HTTP POST request with specified HTTP headers.- Specified by:
postin interfaceRestClient- Type Parameters:
T- Response type.- Parameters:
path- Request path.request- Request object.queryParams- Query parameters.headers- HTTP headers.responseType- Parameterized response type.- Returns:
- HTTP POST response.
- Throws:
RestClientException- Thrown in case HTTP POST request fails.
-
postNonBlocking
public <T> void postNonBlocking(String path, Object request, org.springframework.core.ParameterizedTypeReference<T> responseType, Consumer<org.springframework.http.ResponseEntity<T>> onSuccess, Consumer<Throwable> onError) throws RestClientException Description copied from interface:RestClientExecute a non-blocking HTTP POST request.- Specified by:
postNonBlockingin interfaceRestClient- Type Parameters:
T- Response type.- Parameters:
path- Request path.request- Request object.responseType- Parameterized response type.onSuccess- Consumer used in case of success.onError- Consumer used in case of failure.- Throws:
RestClientException- Thrown in case HTTP POST request fails.
-
postNonBlocking
public <T> void postNonBlocking(String path, Object request, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, throws RestClientExceptionString> headers, org.springframework.core.ParameterizedTypeReference<T> responseType, Consumer<org.springframework.http.ResponseEntity<T>> onSuccess, Consumer<Throwable> onError) Description copied from interface:RestClientExecute a non-blocking HTTP POST request with specified HTTP headers.- Specified by:
postNonBlockingin interfaceRestClient- Type Parameters:
T- Response type.- Parameters:
path- Request path.request- Request object.queryParams- Query parameters.headers- HTTP headers.responseType- Parameterized response type.onSuccess- Consumer used in case of success.onError- Consumer used in case of failure.- Throws:
RestClientException- Thrown in case HTTP POST request fails.
-
postObject
Description copied from interface:RestClientExecute a blocking HTTP POST request with ObjectRequest / Response types.- Specified by:
postObjectin interfaceRestClient- Parameters:
path- Request path.objectRequest- Object request.- Returns:
- Response.
- Throws:
RestClientException- Thrown in case HTTP POST request fails.
-
postObject
public Response postObject(String path, ObjectRequest<?> objectRequest, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, throws RestClientExceptionString> headers) Description copied from interface:RestClientExecute a blocking HTTP POST request with ObjectRequest / Response types and specified query parameters and HTTP headers.- Specified by:
postObjectin interfaceRestClient- Parameters:
path- Request path.objectRequest- Object request.queryParams- Query parameters.headers- HTTP headers.- Returns:
- Response.
- Throws:
RestClientException- Thrown in case HTTP POST request fails.
-
postObject
public <T> ObjectResponse<T> postObject(String path, ObjectRequest<?> objectRequest, Class<T> responseType) throws RestClientException Description copied from interface:RestClientExecute a blocking HTTP POST request with ObjectRequest / ObjectResponse types.- Specified by:
postObjectin interfaceRestClient- Type Parameters:
T- Response type.- Parameters:
path- Request path.objectRequest- Object request.responseType- Object response type.- Returns:
- Object response.
- Throws:
RestClientException- Thrown in case HTTP POST request fails.
-
postObject
public <T> ObjectResponse<T> postObject(String path, ObjectRequest<?> objectRequest, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, throws RestClientExceptionString> headers, Class<T> responseType) Description copied from interface:RestClientExecute a blocking HTTP POST request with ObjectRequest / ObjectResponse types and specified query parameters and HTTP headers.- Specified by:
postObjectin interfaceRestClient- Type Parameters:
T- Response type.- Parameters:
path- Request path.objectRequest- Object request.queryParams- Query parameters.headers- HTTP headers.responseType- Object response type.- Returns:
- Object response.
- Throws:
RestClientException- Thrown in case HTTP POST request fails.
-
put
public <T> org.springframework.http.ResponseEntity<T> put(String path, Object request, org.springframework.core.ParameterizedTypeReference<T> responseType) throws RestClientException Description copied from interface:RestClientExecute a blocking HTTP PUT request.- Specified by:
putin interfaceRestClient- Type Parameters:
T- Response type.- Parameters:
path- Request path.request- Request object.responseType- Parameterized response type.- Returns:
- HTTP PUT response.
- Throws:
RestClientException- Thrown in case HTTP PUT request fails.
-
put
public <T> org.springframework.http.ResponseEntity<T> put(String path, Object request, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, throws RestClientExceptionString> headers, org.springframework.core.ParameterizedTypeReference<T> responseType) Description copied from interface:RestClientExecute a blocking HTTP PUT request with specified HTTP headers.- Specified by:
putin interfaceRestClient- Type Parameters:
T- Response type.- Parameters:
path- Request path.request- Request object.queryParams- Query parameters.headers- HTTP headers.responseType- Parameterized response type.- Returns:
- HTTP PUT response.
- Throws:
RestClientException- Thrown in case HTTP PUT request fails.
-
putNonBlocking
public <T> void putNonBlocking(String path, Object request, org.springframework.core.ParameterizedTypeReference<T> responseType, Consumer<org.springframework.http.ResponseEntity<T>> onSuccess, Consumer<Throwable> onError) throws RestClientException Description copied from interface:RestClientExecute a non-blocking HTTP PUT request.- Specified by:
putNonBlockingin interfaceRestClient- Type Parameters:
T- Response type.- Parameters:
path- Request path.request- Request object.responseType- Parameterized response type.onSuccess- Consumer used in case of success.onError- Consumer used in case of failure.- Throws:
RestClientException- Thrown in case HTTP PUT request fails.
-
putNonBlocking
public <T> void putNonBlocking(String path, Object request, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, throws RestClientExceptionString> headers, org.springframework.core.ParameterizedTypeReference<T> responseType, Consumer<org.springframework.http.ResponseEntity<T>> onSuccess, Consumer<Throwable> onError) Description copied from interface:RestClientExecute a non-blocking HTTP PUT request with specified HTTP headers.- Specified by:
putNonBlockingin interfaceRestClient- Type Parameters:
T- Response type.- Parameters:
path- Request path.request- Request object.queryParams- Query parameters.headers- HTTP headers.responseType- Parameterized response type.onSuccess- Consumer used in case of success.onError- Consumer used in case of failure.- Throws:
RestClientException- Thrown in case HTTP PUT request fails.
-
putObject
Description copied from interface:RestClientExecute a blocking HTTP PUT request with ObjectRequest / Response types.- Specified by:
putObjectin interfaceRestClient- Parameters:
path- Request path.objectRequest- Object request.- Returns:
- Response.
- Throws:
RestClientException- Thrown in case HTTP PUT request fails.
-
putObject
public Response putObject(String path, ObjectRequest<?> objectRequest, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, throws RestClientExceptionString> headers) Description copied from interface:RestClientExecute a blocking HTTP PUT request with ObjectRequest / Response types and specified query parameters and HTTP headers.- Specified by:
putObjectin interfaceRestClient- Parameters:
path- Request path.objectRequest- Object request.queryParams- Query parameters.headers- HTTP headers.- Returns:
- Response.
- Throws:
RestClientException- Thrown in case HTTP PUT request fails.
-
putObject
public <T> ObjectResponse<T> putObject(String path, ObjectRequest<?> objectRequest, Class<T> responseType) throws RestClientException Description copied from interface:RestClientExecute a blocking HTTP PUT request with ObjectRequest / ObjectResponse types.- Specified by:
putObjectin interfaceRestClient- Type Parameters:
T- Response type.- Parameters:
path- Request path.objectRequest- Object request.responseType- Object response type.- Returns:
- Object response.
- Throws:
RestClientException- Thrown in case HTTP PUT request fails.
-
putObject
public <T> ObjectResponse<T> putObject(String path, ObjectRequest<?> objectRequest, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, throws RestClientExceptionString> headers, Class<T> responseType) Description copied from interface:RestClientExecute a blocking HTTP PUT request with ObjectRequest / ObjectResponse types and specified query parameters and HTTP headers.- Specified by:
putObjectin interfaceRestClient- Type Parameters:
T- Response type.- Parameters:
path- Request path.objectRequest- Object request.queryParams- Query parameters.headers- HTTP headers.responseType- Object response type.- Returns:
- Object response.
- Throws:
RestClientException- Thrown in case HTTP PUT request fails.
-
delete
public <T> org.springframework.http.ResponseEntity<T> delete(String path, org.springframework.core.ParameterizedTypeReference<T> responseType) throws RestClientException Description copied from interface:RestClientExecute a blocking HTTP DELETE request.- Specified by:
deletein interfaceRestClient- Type Parameters:
T- Response type.- Parameters:
path- Request path.responseType- Parameterized response type.- Returns:
- HTTP DELETE response.
- Throws:
RestClientException- Thrown in case HTTP DELETE request fails.
-
delete
public <T> org.springframework.http.ResponseEntity<T> delete(String path, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, throws RestClientExceptionString> headers, org.springframework.core.ParameterizedTypeReference<T> responseType) Description copied from interface:RestClientExecute a blocking HTTP DELETE request with specified HTTP headers.- Specified by:
deletein interfaceRestClient- Type Parameters:
T- Response type.- Parameters:
path- Request path.queryParams- Query parameters.headers- HTTP headers.responseType- Parameterized response type.- Returns:
- HTTP DELETE response.
- Throws:
RestClientException- Thrown in case HTTP DELETE request fails.
-
deleteNonBlocking
public <T> void deleteNonBlocking(String path, org.springframework.core.ParameterizedTypeReference<T> responseType, Consumer<org.springframework.http.ResponseEntity<T>> onSuccess, Consumer<Throwable> onError) throws RestClientException Description copied from interface:RestClientExecute a non-blocking HTTP DELETE request.- Specified by:
deleteNonBlockingin interfaceRestClient- Type Parameters:
T- Response type.- Parameters:
path- Request path.responseType- Parameterized response type.onSuccess- Consumer used in case of success.onError- Consumer used in case of failure.- Throws:
RestClientException- Thrown in case HTTP DELETE request fails.
-
deleteNonBlocking
public <T> void deleteNonBlocking(String path, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, throws RestClientExceptionString> headers, org.springframework.core.ParameterizedTypeReference<T> responseType, Consumer<org.springframework.http.ResponseEntity<T>> onSuccess, Consumer<Throwable> onError) Description copied from interface:RestClientExecute a non-blocking HTTP DELETE request with specified HTTP headers.- Specified by:
deleteNonBlockingin interfaceRestClient- Type Parameters:
T- Response type.- Parameters:
path- Request path.queryParams- Query parameters.headers- HTTP headers.responseType- Parameterized response type.onSuccess- Consumer used in case of success.onError- Consumer used in case of failure.- Throws:
RestClientException- Thrown in case HTTP DELETE request fails.
-
deleteObject
Description copied from interface:RestClientExecute a blocking HTTP DELETE request with ObjectRequest / Response types.- Specified by:
deleteObjectin interfaceRestClient- Parameters:
path- Request path.- Returns:
- Response.
- Throws:
RestClientException- Thrown in case HTTP DELETE request fails.
-
deleteObject
public Response deleteObject(String path, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, throws RestClientExceptionString> headers) Description copied from interface:RestClientExecute a blocking HTTP DELETE request with ObjectRequest / Response types and specified query parameters and HTTP headers.- Specified by:
deleteObjectin interfaceRestClient- Parameters:
path- Request path.queryParams- Query parameters.headers- HTTP headers.- Returns:
- Response.
- Throws:
RestClientException- Thrown in case HTTP DELETE request fails.
-
deleteObject
public <T> ObjectResponse<T> deleteObject(String path, Class<T> responseType) throws RestClientException Description copied from interface:RestClientExecute a blocking HTTP DELETE request with ObjectRequest / ObjectResponse types.- Specified by:
deleteObjectin interfaceRestClient- Type Parameters:
T- Response type.- Parameters:
path- Request path.responseType- Object response type.- Returns:
- Object response.
- Throws:
RestClientException- Thrown in case HTTP DELETE request fails.
-
deleteObject
public <T> ObjectResponse<T> deleteObject(String path, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, throws RestClientExceptionString> headers, Class<T> responseType) Description copied from interface:RestClientExecute a blocking HTTP DELETE request with ObjectRequest / ObjectResponse types and specified query parameters and HTTP headers.- Specified by:
deleteObjectin interfaceRestClient- Type Parameters:
T- Response type.- Parameters:
path- Request path.queryParams- Query parameters.headers- HTTP headers.responseType- Object response type.- Returns:
- Object response.
- Throws:
RestClientException- Thrown in case HTTP DELETE request fails.
-
patch
public <T> org.springframework.http.ResponseEntity<T> patch(String path, Object request, org.springframework.core.ParameterizedTypeReference<T> responseType) throws RestClientException Description copied from interface:RestClientExecute a blocking HTTP PATCH request.- Specified by:
patchin interfaceRestClient- Type Parameters:
T- Response type.- Parameters:
path- Request path.request- Request object.responseType- Parameterized response type.- Returns:
- HTTP PUT response.
- Throws:
RestClientException- Thrown in case HTTP PATCH request fails.
-
patch
public <T> org.springframework.http.ResponseEntity<T> patch(String path, Object request, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, throws RestClientExceptionString> headers, org.springframework.core.ParameterizedTypeReference<T> responseType) Description copied from interface:RestClientExecute a blocking HTTP PATCH request with specified HTTP headers.- Specified by:
patchin interfaceRestClient- Type Parameters:
T- Response type.- Parameters:
path- Request path.request- Request object.queryParams- Query parameters.headers- HTTP headers.responseType- Parameterized response type.- Returns:
- HTTP PUT response.
- Throws:
RestClientException- Thrown in case HTTP PATCH request fails.
-
patchNonBlocking
public <T> void patchNonBlocking(String path, Object request, org.springframework.core.ParameterizedTypeReference<T> responseType, Consumer<org.springframework.http.ResponseEntity<T>> onSuccess, Consumer<Throwable> onError) throws RestClientException Description copied from interface:RestClientExecute a non-blocking HTTP PATCH request.- Specified by:
patchNonBlockingin interfaceRestClient- Type Parameters:
T- Response type.- Parameters:
path- Request path.request- Request object.responseType- Parameterized response type.onSuccess- Consumer used in case of success.onError- Consumer used in case of failure.- Throws:
RestClientException- Thrown in case HTTP PATCH request fails.
-
patchNonBlocking
public <T> void patchNonBlocking(String path, Object request, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, throws RestClientExceptionString> headers, org.springframework.core.ParameterizedTypeReference<T> responseType, Consumer<org.springframework.http.ResponseEntity<T>> onSuccess, Consumer<Throwable> onError) Description copied from interface:RestClientExecute a non-blocking HTTP PATCH request with specified HTTP headers.- Specified by:
patchNonBlockingin interfaceRestClient- Type Parameters:
T- Response type.- Parameters:
path- Request path.request- Request object.queryParams- Query parameters.headers- HTTP headers.responseType- Parameterized response type.onSuccess- Consumer used in case of success.onError- Consumer used in case of failure.- Throws:
RestClientException- Thrown in case HTTP PATCH request fails.
-
patchObject
Description copied from interface:RestClientExecute a blocking HTTP PATCH request with ObjectRequest / Response types.- Specified by:
patchObjectin interfaceRestClient- Parameters:
path- Request path.objectRequest- Object request.- Returns:
- Response.
- Throws:
RestClientException- Thrown in case HTTP PATCH request fails.
-
patchObject
public Response patchObject(String path, ObjectRequest<?> objectRequest, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, throws RestClientExceptionString> headers) Description copied from interface:RestClientExecute a blocking HTTP PATCH request with ObjectRequest / Response types and specified query parameters and HTTP headers.- Specified by:
patchObjectin interfaceRestClient- Parameters:
path- Request path.objectRequest- Object request.queryParams- Query parameters.headers- HTTP headers.- Returns:
- Response.
- Throws:
RestClientException- Thrown in case HTTP PATCH request fails.
-
patchObject
public <T> ObjectResponse<T> patchObject(String path, ObjectRequest<?> objectRequest, Class<T> responseType) throws RestClientException Description copied from interface:RestClientExecute a blocking HTTP PATCH request with ObjectRequest / ObjectResponse types.- Specified by:
patchObjectin interfaceRestClient- Type Parameters:
T- Response type.- Parameters:
path- Request path.objectRequest- Object request.responseType- Object response type.- Returns:
- Object response.
- Throws:
RestClientException- Thrown in case HTTP PATCH request fails.
-
patchObject
public <T> ObjectResponse<T> patchObject(String path, ObjectRequest<?> objectRequest, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, throws RestClientExceptionString> headers, Class<T> responseType) Description copied from interface:RestClientExecute a blocking HTTP PATCH request with ObjectRequest / ObjectResponse types and specified query parameters and HTTP headers.- Specified by:
patchObjectin interfaceRestClient- Type Parameters:
T- Response type.- Parameters:
path- Request path.objectRequest- Object request.queryParams- Query parameters.headers- HTTP headers.responseType- Object response type.- Returns:
- Object response.
- Throws:
RestClientException- Thrown in case HTTP PATCH request fails.
-
head
public <T> org.springframework.http.ResponseEntity<T> head(String path, org.springframework.core.ParameterizedTypeReference<T> responseType) throws RestClientException Description copied from interface:RestClientExecute a blocking HTTP HEAD request.- Specified by:
headin interfaceRestClient- Type Parameters:
T- Response type.- Parameters:
path- Request path.responseType- Parameterized response type.- Returns:
- HTTP HEAD response.
- Throws:
RestClientException- Thrown in case HTTP HEAD request fails.
-
head
public <T> org.springframework.http.ResponseEntity<T> head(String path, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, throws RestClientExceptionString> headers, org.springframework.core.ParameterizedTypeReference<T> responseType) Description copied from interface:RestClientExecute a blocking HTTP HEAD request with specified HTTP headers.- Specified by:
headin interfaceRestClient- Type Parameters:
T- Response type.- Parameters:
path- Request path.queryParams- Query parameters.headers- HTTP headers.responseType- Parameterized response type.- Returns:
- HTTP HEAD response.
- Throws:
RestClientException- Thrown in case HTTP HEAD request fails.
-
headNonBlocking
public <T> void headNonBlocking(String path, org.springframework.core.ParameterizedTypeReference<T> responseType, Consumer<org.springframework.http.ResponseEntity<T>> onSuccess, Consumer<Throwable> onError) throws RestClientException Description copied from interface:RestClientExecute a non-blocking HTTP HEAD request.- Specified by:
headNonBlockingin interfaceRestClient- Type Parameters:
T- Response type.- Parameters:
path- Request path.responseType- Parameterized response type.onSuccess- Consumer used in case of success.onError- Consumer used in case of failure.- Throws:
RestClientException- Thrown in case HTTP HEAD request fails.
-
headNonBlocking
public <T> void headNonBlocking(String path, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, throws RestClientExceptionString> headers, org.springframework.core.ParameterizedTypeReference<T> responseType, Consumer<org.springframework.http.ResponseEntity<T>> onSuccess, Consumer<Throwable> onError) Description copied from interface:RestClientExecute a non-blocking HTTP HEAD request with specified HTTP headers.- Specified by:
headNonBlockingin interfaceRestClient- Type Parameters:
T- Response type.- Parameters:
path- Request path.queryParams- Query parameters.headers- HTTP headers.responseType- Parameterized response type.onSuccess- Consumer used in case of success.onError- Consumer used in case of failure.- Throws:
RestClientException- Thrown in case HTTP HEAD request fails.
-
headObject
Description copied from interface:RestClientExecute a blocking HTTP HEAD request with ObjectRequest / Response types.- Specified by:
headObjectin interfaceRestClient- Parameters:
path- Request path.- Returns:
- Response.
- Throws:
RestClientException- Thrown in case HTTP HEAD request fails.
-
headObject
public Response headObject(String path, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, throws RestClientExceptionString> headers) Description copied from interface:RestClientExecute a blocking HTTP HEAD request with ObjectRequest / Response types and specified query parameters and HTTP headers.- Specified by:
headObjectin interfaceRestClient- Parameters:
path- Request path.queryParams- Query parameters.headers- HTTP headers.- Returns:
- Response.
- Throws:
RestClientException- Thrown in case HTTP HEAD request fails.
-
headObject
public <T> ObjectResponse<T> headObject(String path, Class<T> responseType) throws RestClientException Description copied from interface:RestClientExecute a blocking HTTP HEAD request with ObjectRequest / ObjectResponse types.- Specified by:
headObjectin interfaceRestClient- Type Parameters:
T- Response type.- Parameters:
path- Request path.responseType- Object response type.- Returns:
- Object response.
- Throws:
RestClientException- Thrown in case HTTP HEAD request fails.
-
headObject
public <T> ObjectResponse<T> headObject(String path, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.util.MultiValueMap<String, throws RestClientExceptionString> headers, Class<T> responseType) Description copied from interface:RestClientExecute a blocking HTTP HEAD request with ObjectRequest / ObjectResponse types and specified query parameters and HTTP headers.- Specified by:
headObjectin interfaceRestClient- Type Parameters:
T- Response type.- Parameters:
path- Request path.queryParams- Query parameters.headers- HTTP headers.responseType- Object response type.- Returns:
- Object response.
- Throws:
RestClientException- Thrown in case HTTP HEAD request fails.
-
builder
Construct a new rest client builder.- Returns:
- Builder.
-