- All Known Implementing Classes:
JavaRestClient
@NullMarked
public interface RestClient
RestClient defines the api for creating rest client implementations for sending HTTP requests.
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
delete
(String path, Consumer<HttpResponse> httpResponseSupplier) Convenience method aroundrequest(String, String, JsonElement, Consumer)
for making a DELETE request.default void
delete
(String path, technology.sola.json.JsonArray body, Consumer<HttpResponse> httpResponseSupplier) Convenience method aroundrequest(String, String, JsonElement, Consumer)
for making a DELETE request.default void
delete
(String path, technology.sola.json.JsonElement body, Consumer<HttpResponse> httpResponseSupplier) Convenience method aroundrequest(String, String, JsonElement, Consumer)
for making a DELETE request.default void
delete
(String path, technology.sola.json.JsonObject body, Consumer<HttpResponse> httpResponseSupplier) Convenience method aroundrequest(String, String, JsonElement, Consumer)
for making a DELETE request.default void
get
(String path, Consumer<HttpResponse> httpResponseSupplier) Convenience method aroundrequest(String, String, JsonElement, Consumer)
for making a GET request.default void
post
(String path, Consumer<HttpResponse> httpResponseSupplier) Convenience method aroundrequest(String, String, JsonElement, Consumer)
for making a POST request.default void
post
(String path, technology.sola.json.JsonArray body, Consumer<HttpResponse> httpResponseSupplier) Convenience method aroundrequest(String, String, JsonElement, Consumer)
for making a POST request.default void
post
(String path, technology.sola.json.JsonElement body, Consumer<HttpResponse> httpResponseSupplier) Convenience method aroundrequest(String, String, JsonElement, Consumer)
for making a POST request.default void
post
(String path, technology.sola.json.JsonObject body, Consumer<HttpResponse> httpResponseSupplier) Convenience method aroundrequest(String, String, JsonElement, Consumer)
for making a POST request.default void
put
(String path, Consumer<HttpResponse> httpResponseSupplier) Convenience method aroundrequest(String, String, JsonElement, Consumer)
for making a PUT request.default void
put
(String path, technology.sola.json.JsonArray body, Consumer<HttpResponse> httpResponseSupplier) Convenience method aroundrequest(String, String, JsonElement, Consumer)
for making a PUT request.default void
put
(String path, technology.sola.json.JsonElement body, Consumer<HttpResponse> httpResponseSupplier) Convenience method aroundrequest(String, String, JsonElement, Consumer)
for making a PUT request.default void
put
(String path, technology.sola.json.JsonObject body, Consumer<HttpResponse> httpResponseSupplier) Convenience method aroundrequest(String, String, JsonElement, Consumer)
for making a PUT request.void
request
(String method, String path, technology.sola.json.JsonElement body, Consumer<HttpResponse> httpResponseSupplier) Creates and sends an HTTP request.
-
Method Details
-
request
void request(String method, String path, technology.sola.json.JsonElement body, Consumer<HttpResponse> httpResponseSupplier) Creates and sends an HTTP request. TheHttpResponse
from the server as provided in a callback.Note: body is ignored when method is "GET"
- Parameters:
method
- the http method for the requestpath
- the path for the requestbody
- the request bodyhttpResponseSupplier
- the callback when the request finishes and the response is available
-
get
Convenience method aroundrequest(String, String, JsonElement, Consumer)
for making a GET request.- Parameters:
path
- the path for the requesthttpResponseSupplier
- the callback when the request finishes and the response is available
-
post
Convenience method aroundrequest(String, String, JsonElement, Consumer)
for making a POST request.- Parameters:
path
- the path for the requesthttpResponseSupplier
- 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 aroundrequest(String, String, JsonElement, Consumer)
for making a POST request.- Parameters:
path
- the path for the requestbody
- the request bodyhttpResponseSupplier
- 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 aroundrequest(String, String, JsonElement, Consumer)
for making a POST request.- Parameters:
path
- the path for the requestbody
- the request bodyhttpResponseSupplier
- 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 aroundrequest(String, String, JsonElement, Consumer)
for making a POST request.- Parameters:
path
- the path for the requestbody
- the request bodyhttpResponseSupplier
- the callback when the request finishes and the response is available
-
put
Convenience method aroundrequest(String, String, JsonElement, Consumer)
for making a PUT request.- Parameters:
path
- the path for the requesthttpResponseSupplier
- 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 aroundrequest(String, String, JsonElement, Consumer)
for making a PUT request.- Parameters:
path
- the path for the requestbody
- the request bodyhttpResponseSupplier
- 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 aroundrequest(String, String, JsonElement, Consumer)
for making a PUT request.- Parameters:
path
- the path for the requestbody
- the request bodyhttpResponseSupplier
- 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 aroundrequest(String, String, JsonElement, Consumer)
for making a PUT request.- Parameters:
path
- the path for the requestbody
- the request bodyhttpResponseSupplier
- the callback when the request finishes and the response is available
-
delete
Convenience method aroundrequest(String, String, JsonElement, Consumer)
for making a DELETE request.- Parameters:
path
- the path for the requesthttpResponseSupplier
- 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 aroundrequest(String, String, JsonElement, Consumer)
for making a DELETE request.- Parameters:
path
- the path for the requestbody
- the request bodyhttpResponseSupplier
- 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 aroundrequest(String, String, JsonElement, Consumer)
for making a DELETE request.- Parameters:
path
- the path for the requestbody
- the request bodyhttpResponseSupplier
- 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 aroundrequest(String, String, JsonElement, Consumer)
for making a DELETE request.- Parameters:
path
- the path for the requestbody
- the request bodyhttpResponseSupplier
- the callback when the request finishes and the response is available
-