Class DefaultRestClient

java.lang.Object
com.wultra.core.rest.client.base.DefaultRestClient
All Implemented Interfaces:
RestClient

public class DefaultRestClient extends Object implements RestClient
Default REST client implementation based on WebClient.
Author:
Roman Strobl, roman.strobl@wultra.com
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Builder used for configuration of the default rest client.
    static class 
    Certificate authentication builder.
    static class 
    HTTP basic authentication builder.
    static class 
    HTTP digest authentication builder.
    static class 
    Proxy builder.
  • Constructor Summary

    Constructors
    Constructor
    Description
    DefaultRestClient(RestClientConfiguration config, com.fasterxml.jackson.databind.Module... modules)
    Construct default REST client with specified configuration.
    Construct default REST client without any additional configuration.
  • Method Summary

    Modifier and Type
    Method
    Description
    Construct a new rest client builder.
    <T> org.springframework.http.ResponseEntity<T>
    delete(String path, org.springframework.core.ParameterizedTypeReference<T> responseType)
    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> void
    deleteNonBlocking(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> void
    deleteNonBlocking(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.
    Execute a blocking HTTP DELETE request with ObjectRequest / Response types.
    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.
    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>
    get(String path, org.springframework.core.ParameterizedTypeReference<T> responseType)
    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> void
    getNonBlocking(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> void
    getNonBlocking(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.
    getObject(String path, Class<T> responseType)
    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.
    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>
    head(String path, org.springframework.core.ParameterizedTypeReference<T> responseType)
    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> void
    headNonBlocking(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> void
    headNonBlocking(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.
    Execute a blocking HTTP HEAD request with ObjectRequest / Response types.
    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.
    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> void
    patchNonBlocking(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> void
    patchNonBlocking(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.
    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.
    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> void
    postNonBlocking(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> void
    postNonBlocking(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.
    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.
    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> void
    putNonBlocking(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> void
    putNonBlocking(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.
    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.
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DefaultRestClient

      public DefaultRestClient(String baseUrl) throws RestClientException
      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: RestClient
      Execute a blocking HTTP GET request.
      Specified by:
      get in interface RestClient
      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,String> headers, org.springframework.core.ParameterizedTypeReference<T> responseType) throws RestClientException
      Description copied from interface: RestClient
      Execute a blocking HTTP GET request with specified HTTP headers.
      Specified by:
      get in interface RestClient
      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: RestClient
      Execute a non-blocking HTTP GET request.
      Specified by:
      getNonBlocking in interface RestClient
      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,String> headers, org.springframework.core.ParameterizedTypeReference<T> responseType, Consumer<org.springframework.http.ResponseEntity<T>> onSuccess, Consumer<Throwable> onError) throws RestClientException
      Description copied from interface: RestClient
      Execute a non-blocking HTTP GET request with specified HTTP headers.
      Specified by:
      getNonBlocking in interface RestClient
      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

      public Response getObject(String path) throws RestClientException
      Description copied from interface: RestClient
      Execute a blocking HTTP GET request with ObjectRequest / Response types.
      Specified by:
      getObject in interface RestClient
      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,String> headers) throws RestClientException
      Description copied from interface: RestClient
      Execute a blocking HTTP GET request with ObjectRequest / Response types and specified query parameters and HTTP headers.
      Specified by:
      getObject in interface RestClient
      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: RestClient
      Execute a blocking HTTP GET request with ObjectRequest / ObjectResponse types.
      Specified by:
      getObject in interface RestClient
      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,String> headers, Class<T> responseType) throws RestClientException
      Description copied from interface: RestClient
      Execute a blocking HTTP GET request with ObjectRequest / ObjectResponse types and specified query parameters and HTTP headers.
      Specified by:
      getObject in interface RestClient
      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: RestClient
      Execute a blocking HTTP POST request.
      Specified by:
      post in interface RestClient
      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,String> headers, org.springframework.core.ParameterizedTypeReference<T> responseType) throws RestClientException
      Description copied from interface: RestClient
      Execute a blocking HTTP POST request with specified HTTP headers.
      Specified by:
      post in interface RestClient
      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: RestClient
      Execute a non-blocking HTTP POST request.
      Specified by:
      postNonBlocking in interface RestClient
      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,String> headers, org.springframework.core.ParameterizedTypeReference<T> responseType, Consumer<org.springframework.http.ResponseEntity<T>> onSuccess, Consumer<Throwable> onError) throws RestClientException
      Description copied from interface: RestClient
      Execute a non-blocking HTTP POST request with specified HTTP headers.
      Specified by:
      postNonBlocking in interface RestClient
      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

      public Response postObject(String path, ObjectRequest<?> objectRequest) throws RestClientException
      Description copied from interface: RestClient
      Execute a blocking HTTP POST request with ObjectRequest / Response types.
      Specified by:
      postObject in interface RestClient
      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,String> headers) throws RestClientException
      Description copied from interface: RestClient
      Execute a blocking HTTP POST request with ObjectRequest / Response types and specified query parameters and HTTP headers.
      Specified by:
      postObject in interface RestClient
      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: RestClient
      Execute a blocking HTTP POST request with ObjectRequest / ObjectResponse types.
      Specified by:
      postObject in interface RestClient
      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,String> headers, Class<T> responseType) throws RestClientException
      Description copied from interface: RestClient
      Execute a blocking HTTP POST request with ObjectRequest / ObjectResponse types and specified query parameters and HTTP headers.
      Specified by:
      postObject in interface RestClient
      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: RestClient
      Execute a blocking HTTP PUT request.
      Specified by:
      put in interface RestClient
      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,String> headers, org.springframework.core.ParameterizedTypeReference<T> responseType) throws RestClientException
      Description copied from interface: RestClient
      Execute a blocking HTTP PUT request with specified HTTP headers.
      Specified by:
      put in interface RestClient
      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: RestClient
      Execute a non-blocking HTTP PUT request.
      Specified by:
      putNonBlocking in interface RestClient
      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,String> headers, org.springframework.core.ParameterizedTypeReference<T> responseType, Consumer<org.springframework.http.ResponseEntity<T>> onSuccess, Consumer<Throwable> onError) throws RestClientException
      Description copied from interface: RestClient
      Execute a non-blocking HTTP PUT request with specified HTTP headers.
      Specified by:
      putNonBlocking in interface RestClient
      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

      public Response putObject(String path, ObjectRequest<?> objectRequest) throws RestClientException
      Description copied from interface: RestClient
      Execute a blocking HTTP PUT request with ObjectRequest / Response types.
      Specified by:
      putObject in interface RestClient
      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,String> headers) throws RestClientException
      Description copied from interface: RestClient
      Execute a blocking HTTP PUT request with ObjectRequest / Response types and specified query parameters and HTTP headers.
      Specified by:
      putObject in interface RestClient
      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: RestClient
      Execute a blocking HTTP PUT request with ObjectRequest / ObjectResponse types.
      Specified by:
      putObject in interface RestClient
      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,String> headers, Class<T> responseType) throws RestClientException
      Description copied from interface: RestClient
      Execute a blocking HTTP PUT request with ObjectRequest / ObjectResponse types and specified query parameters and HTTP headers.
      Specified by:
      putObject in interface RestClient
      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: RestClient
      Execute a blocking HTTP DELETE request.
      Specified by:
      delete in interface RestClient
      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,String> headers, org.springframework.core.ParameterizedTypeReference<T> responseType) throws RestClientException
      Description copied from interface: RestClient
      Execute a blocking HTTP DELETE request with specified HTTP headers.
      Specified by:
      delete in interface RestClient
      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: RestClient
      Execute a non-blocking HTTP DELETE request.
      Specified by:
      deleteNonBlocking in interface RestClient
      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,String> headers, org.springframework.core.ParameterizedTypeReference<T> responseType, Consumer<org.springframework.http.ResponseEntity<T>> onSuccess, Consumer<Throwable> onError) throws RestClientException
      Description copied from interface: RestClient
      Execute a non-blocking HTTP DELETE request with specified HTTP headers.
      Specified by:
      deleteNonBlocking in interface RestClient
      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

      public Response deleteObject(String path) throws RestClientException
      Description copied from interface: RestClient
      Execute a blocking HTTP DELETE request with ObjectRequest / Response types.
      Specified by:
      deleteObject in interface RestClient
      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,String> headers) throws RestClientException
      Description copied from interface: RestClient
      Execute a blocking HTTP DELETE request with ObjectRequest / Response types and specified query parameters and HTTP headers.
      Specified by:
      deleteObject in interface RestClient
      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: RestClient
      Execute a blocking HTTP DELETE request with ObjectRequest / ObjectResponse types.
      Specified by:
      deleteObject in interface RestClient
      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,String> headers, Class<T> responseType) throws RestClientException
      Description copied from interface: RestClient
      Execute a blocking HTTP DELETE request with ObjectRequest / ObjectResponse types and specified query parameters and HTTP headers.
      Specified by:
      deleteObject in interface RestClient
      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: RestClient
      Execute a blocking HTTP PATCH request.
      Specified by:
      patch in interface RestClient
      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,String> headers, org.springframework.core.ParameterizedTypeReference<T> responseType) throws RestClientException
      Description copied from interface: RestClient
      Execute a blocking HTTP PATCH request with specified HTTP headers.
      Specified by:
      patch in interface RestClient
      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: RestClient
      Execute a non-blocking HTTP PATCH request.
      Specified by:
      patchNonBlocking in interface RestClient
      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,String> headers, org.springframework.core.ParameterizedTypeReference<T> responseType, Consumer<org.springframework.http.ResponseEntity<T>> onSuccess, Consumer<Throwable> onError) throws RestClientException
      Description copied from interface: RestClient
      Execute a non-blocking HTTP PATCH request with specified HTTP headers.
      Specified by:
      patchNonBlocking in interface RestClient
      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

      public Response patchObject(String path, ObjectRequest<?> objectRequest) throws RestClientException
      Description copied from interface: RestClient
      Execute a blocking HTTP PATCH request with ObjectRequest / Response types.
      Specified by:
      patchObject in interface RestClient
      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,String> headers) throws RestClientException
      Description copied from interface: RestClient
      Execute a blocking HTTP PATCH request with ObjectRequest / Response types and specified query parameters and HTTP headers.
      Specified by:
      patchObject in interface RestClient
      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: RestClient
      Execute a blocking HTTP PATCH request with ObjectRequest / ObjectResponse types.
      Specified by:
      patchObject in interface RestClient
      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,String> headers, Class<T> responseType) throws RestClientException
      Description copied from interface: RestClient
      Execute a blocking HTTP PATCH request with ObjectRequest / ObjectResponse types and specified query parameters and HTTP headers.
      Specified by:
      patchObject in interface RestClient
      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: RestClient
      Execute a blocking HTTP HEAD request.
      Specified by:
      head in interface RestClient
      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,String> headers, org.springframework.core.ParameterizedTypeReference<T> responseType) throws RestClientException
      Description copied from interface: RestClient
      Execute a blocking HTTP HEAD request with specified HTTP headers.
      Specified by:
      head in interface RestClient
      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: RestClient
      Execute a non-blocking HTTP HEAD request.
      Specified by:
      headNonBlocking in interface RestClient
      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,String> headers, org.springframework.core.ParameterizedTypeReference<T> responseType, Consumer<org.springframework.http.ResponseEntity<T>> onSuccess, Consumer<Throwable> onError) throws RestClientException
      Description copied from interface: RestClient
      Execute a non-blocking HTTP HEAD request with specified HTTP headers.
      Specified by:
      headNonBlocking in interface RestClient
      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

      public Response headObject(String path) throws RestClientException
      Description copied from interface: RestClient
      Execute a blocking HTTP HEAD request with ObjectRequest / Response types.
      Specified by:
      headObject in interface RestClient
      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,String> headers) throws RestClientException
      Description copied from interface: RestClient
      Execute a blocking HTTP HEAD request with ObjectRequest / Response types and specified query parameters and HTTP headers.
      Specified by:
      headObject in interface RestClient
      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: RestClient
      Execute a blocking HTTP HEAD request with ObjectRequest / ObjectResponse types.
      Specified by:
      headObject in interface RestClient
      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,String> headers, Class<T> responseType) throws RestClientException
      Description copied from interface: RestClient
      Execute a blocking HTTP HEAD request with ObjectRequest / ObjectResponse types and specified query parameters and HTTP headers.
      Specified by:
      headObject in interface RestClient
      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

      public static DefaultRestClient.Builder builder()
      Construct a new rest client builder.
      Returns:
      Builder.