Annotation Interface Get


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

GET requests are used to retrieve data from the server and should be idempotent and safe (no side effects). They typically don't include request bodies and use path parameters and query parameters for input.

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 extract URL segments as method parameters. Parameters can be strings, numbers, or other primitive types.

Query Parameters: Access query parameters via RequestContext.queryParams() when extending AbstractHttpEndpoint or injecting RequestContext.

Response Types: GET methods can return strings, objects (serialized to JSON), HttpResponse for full control, or CompletionStage<T> for asynchronous responses.

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
     
  • Element Details

    • value

      String value
      Default:
      ""