diff --git a/barista-conjure/src/main/java/com/markelliot/barista/conjure/ConjureAdapter.java b/barista-conjure/src/main/java/com/markelliot/barista/conjure/ConjureAdapter.java index 2ab05da..6181d92 100644 --- a/barista-conjure/src/main/java/com/markelliot/barista/conjure/ConjureAdapter.java +++ b/barista-conjure/src/main/java/com/markelliot/barista/conjure/ConjureAdapter.java @@ -60,6 +60,7 @@ public HttpMethod method() { case "GET" -> HttpMethod.GET; case "PUT" -> HttpMethod.PUT; case "POST" -> HttpMethod.POST; + case "DELETE" -> HttpMethod.DELETE; default -> throw new IllegalStateException( "Unsupported HTTP method " + endpoint.method()); }; diff --git a/barista/src/main/java/com/markelliot/barista/HttpMethod.java b/barista/src/main/java/com/markelliot/barista/HttpMethod.java index 6074e22..e718ef6 100644 --- a/barista/src/main/java/com/markelliot/barista/HttpMethod.java +++ b/barista/src/main/java/com/markelliot/barista/HttpMethod.java @@ -23,7 +23,8 @@ public enum HttpMethod { GET(Methods.GET), PUT(Methods.PUT), - POST(Methods.POST); + POST(Methods.POST), + DELETE(Methods.DELETE); private final HttpString method; diff --git a/barista/src/main/java/com/markelliot/barista/handlers/EndpointHandlerBuilder.java b/barista/src/main/java/com/markelliot/barista/handlers/EndpointHandlerBuilder.java index 576f587..24f978c 100644 --- a/barista/src/main/java/com/markelliot/barista/handlers/EndpointHandlerBuilder.java +++ b/barista/src/main/java/com/markelliot/barista/handlers/EndpointHandlerBuilder.java @@ -66,7 +66,8 @@ private HttpHandler authEndpoint( Endpoints.VerifiedAuth endpoint) { return switch (endpoint.method()) { case GET -> exchange -> authNoBody(endpoint, exchange); - case PUT, POST -> withBody((exchange, body) -> authWithBody(endpoint, exchange, body)); + case PUT, POST, DELETE -> withBody( + (exchange, body) -> authWithBody(endpoint, exchange, body)); }; } @@ -74,7 +75,8 @@ public HttpHandler openEndpoint( Endpoints.Open endpoint) { return switch (endpoint.method()) { case GET -> exchange -> openNoBody(endpoint, exchange); - case PUT, POST -> withBody((exchange, body) -> openWithBody(endpoint, exchange, body)); + case PUT, POST, DELETE -> withBody( + (exchange, body) -> openWithBody(endpoint, exchange, body)); }; }