- 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 voiddelete(String path, Consumer<HttpResponse> httpResponseSupplier) Convenience method aroundrequest(String, String, JsonElement, Consumer)for making a DELETE request.default voiddelete(String path, technology.sola.json.JsonArray body, Consumer<HttpResponse> httpResponseSupplier) Convenience method aroundrequest(String, String, JsonElement, Consumer)for making a DELETE request.default voiddelete(String path, technology.sola.json.JsonElement body, Consumer<HttpResponse> httpResponseSupplier) Convenience method aroundrequest(String, String, JsonElement, Consumer)for making a DELETE request.default voiddelete(String path, technology.sola.json.JsonObject body, Consumer<HttpResponse> httpResponseSupplier) Convenience method aroundrequest(String, String, JsonElement, Consumer)for making a DELETE request.default voidget(String path, Consumer<HttpResponse> httpResponseSupplier) Convenience method aroundrequest(String, String, JsonElement, Consumer)for making a GET request.default voidpost(String path, Consumer<HttpResponse> httpResponseSupplier) Convenience method aroundrequest(String, String, JsonElement, Consumer)for making a POST request.default voidpost(String path, technology.sola.json.JsonArray body, Consumer<HttpResponse> httpResponseSupplier) Convenience method aroundrequest(String, String, JsonElement, Consumer)for making a POST request.default voidpost(String path, technology.sola.json.JsonElement body, Consumer<HttpResponse> httpResponseSupplier) Convenience method aroundrequest(String, String, JsonElement, Consumer)for making a POST request.default voidpost(String path, technology.sola.json.JsonObject body, Consumer<HttpResponse> httpResponseSupplier) Convenience method aroundrequest(String, String, JsonElement, Consumer)for making a POST request.default voidput(String path, Consumer<HttpResponse> httpResponseSupplier) Convenience method aroundrequest(String, String, JsonElement, Consumer)for making a PUT request.default voidput(String path, technology.sola.json.JsonArray body, Consumer<HttpResponse> httpResponseSupplier) Convenience method aroundrequest(String, String, JsonElement, Consumer)for making a PUT request.default voidput(String path, technology.sola.json.JsonElement body, Consumer<HttpResponse> httpResponseSupplier) Convenience method aroundrequest(String, String, JsonElement, Consumer)for making a PUT request.default voidput(String path, technology.sola.json.JsonObject body, Consumer<HttpResponse> httpResponseSupplier) Convenience method aroundrequest(String, String, JsonElement, Consumer)for making a PUT request.voidrequest(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. TheHttpResponsefrom 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
-