Annotation Interface Post


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

POST requests are used to create new resources or submit data to the server. They typically include request bodies with the data to be processed and can have side effects.

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.

Request Bodies: POST methods commonly accept request bodies by adding a parameter that Jackson can deserialize from JSON. The request body parameter must come last in the parameter list when combined with path parameters.

Path Parameters: Use {paramName} in the path to extract URL segments as method parameters. These can be combined with request body parameters.

Response Types: POST methods typically return created resources (often with 201 Created status), confirmation messages, or error responses. Use HttpResponses.created() for resource creation scenarios.

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
     
  • Element Details

    • value

      String value
      Default:
      ""