Annotation Interface Delete


@Target(METHOD) @Retention(RUNTIME) @Documented public @interface Delete
Annotation to mark a method as handling HTTP DELETE requests.

DELETE requests are used to remove resources from the server. They should be idempotent, meaning multiple identical requests should have the same effect (the resource remains deleted).

Path Configuration: The annotation value specifies the path pattern for this endpoint, which is combined with the HttpEndpoint class-level path prefix to form the complete URL.

Path Parameters: Use {paramName} in the path to identify the specific resource to delete. DELETE requests typically don't include request bodies.

Response Types: DELETE methods typically return:

  • 204 No Content for successful deletion with no response body
  • 200 OK with confirmation message or deleted resource representation
  • 404 Not Found if the resource doesn't exist
Use HttpResponses.noContent() for standard deletion responses.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
     
  • Element Details

    • value

      String value
      Default:
      ""