Interface RestClient

All Known Implementing Classes:
JavaRestClient

@NullMarked public interface RestClient
RestClient defines the api for creating rest client implementations for sending HTTP requests.
  • Method Details

    • request

      void request(String method, String path, technology.sola.json.JsonElement body, Consumer<HttpResponse> httpResponseSupplier)
      Creates and sends an HTTP request. The HttpResponse from the server as provided in a callback.

      Note: body is ignored when method is "GET"

      Parameters:
      method - the http method for the request
      path - the path for the request
      body - the request body
      httpResponseSupplier - the callback when the request finishes and the response is available
    • get

      default void get(String path, Consumer<HttpResponse> httpResponseSupplier)
      Convenience method around request(String, String, JsonElement, Consumer) for making a GET request.
      Parameters:
      path - the path for the request
      httpResponseSupplier - the callback when the request finishes and the response is available
    • post

      default void post(String path, Consumer<HttpResponse> httpResponseSupplier)
      Convenience method around request(String, String, JsonElement, Consumer) for making a POST request.
      Parameters:
      path - the path for the request
      httpResponseSupplier - the callback when the request finishes and the response is available
    • post

      default void post(String path, technology.sola.json.JsonElement body, Consumer<HttpResponse> httpResponseSupplier)
      Convenience method around request(String, String, JsonElement, Consumer) for making a POST request.
      Parameters:
      path - the path for the request
      body - the request body
      httpResponseSupplier - the callback when the request finishes and the response is available
    • post

      default void post(String path, technology.sola.json.JsonObject body, Consumer<HttpResponse> httpResponseSupplier)
      Convenience method around request(String, String, JsonElement, Consumer) for making a POST request.
      Parameters:
      path - the path for the request
      body - the request body
      httpResponseSupplier - the callback when the request finishes and the response is available
    • post

      default void post(String path, technology.sola.json.JsonArray body, Consumer<HttpResponse> httpResponseSupplier)
      Convenience method around request(String, String, JsonElement, Consumer) for making a POST request.
      Parameters:
      path - the path for the request
      body - the request body
      httpResponseSupplier - the callback when the request finishes and the response is available
    • put

      default void put(String path, Consumer<HttpResponse> httpResponseSupplier)
      Convenience method around request(String, String, JsonElement, Consumer) for making a PUT request.
      Parameters:
      path - the path for the request
      httpResponseSupplier - the callback when the request finishes and the response is available
    • put

      default void put(String path, technology.sola.json.JsonElement body, Consumer<HttpResponse> httpResponseSupplier)
      Convenience method around request(String, String, JsonElement, Consumer) for making a PUT request.
      Parameters:
      path - the path for the request
      body - the request body
      httpResponseSupplier - the callback when the request finishes and the response is available
    • put

      default void put(String path, technology.sola.json.JsonObject body, Consumer<HttpResponse> httpResponseSupplier)
      Convenience method around request(String, String, JsonElement, Consumer) for making a PUT request.
      Parameters:
      path - the path for the request
      body - the request body
      httpResponseSupplier - the callback when the request finishes and the response is available
    • put

      default void put(String path, technology.sola.json.JsonArray body, Consumer<HttpResponse> httpResponseSupplier)
      Convenience method around request(String, String, JsonElement, Consumer) for making a PUT request.
      Parameters:
      path - the path for the request
      body - the request body
      httpResponseSupplier - the callback when the request finishes and the response is available
    • delete

      default void delete(String path, Consumer<HttpResponse> httpResponseSupplier)
      Convenience method around request(String, String, JsonElement, Consumer) for making a DELETE request.
      Parameters:
      path - the path for the request
      httpResponseSupplier - the callback when the request finishes and the response is available
    • delete

      default void delete(String path, technology.sola.json.JsonElement body, Consumer<HttpResponse> httpResponseSupplier)
      Convenience method around request(String, String, JsonElement, Consumer) for making a DELETE request.
      Parameters:
      path - the path for the request
      body - the request body
      httpResponseSupplier - the callback when the request finishes and the response is available
    • delete

      default void delete(String path, technology.sola.json.JsonObject body, Consumer<HttpResponse> httpResponseSupplier)
      Convenience method around request(String, String, JsonElement, Consumer) for making a DELETE request.
      Parameters:
      path - the path for the request
      body - the request body
      httpResponseSupplier - the callback when the request finishes and the response is available
    • delete

      default void delete(String path, technology.sola.json.JsonArray body, Consumer<HttpResponse> httpResponseSupplier)
      Convenience method around request(String, String, JsonElement, Consumer) for making a DELETE request.
      Parameters:
      path - the path for the request
      body - the request body
      httpResponseSupplier - the callback when the request finishes and the response is available