Annotation Interface Http.FormParam

Enclosing class:
Http

@Target({PARAMETER,RECORD_COMPONENT}) @Retention(CLASS) @Documented @Qualifier public static @interface Http.FormParam
Inject a URL encoded form parameter into a server method parameter, or send a form parameter from a declarative client method parameter.

Can also be used on Http.RequestParams record components.

Declarative endpoints and clients should use this annotation with @Http.Consumes("application/x-www-form-urlencoded"). Form parameters use the request entity and cannot be combined with Http.Entity on the same declarative method.

Declarative server endpoints support List<T> for mandatory multi-value form parameters and Optional<List<T>> for optional multi-value form parameters. A mandatory list is rejected when the named form parameter is missing, while an optional list is empty when the named form parameter is missing. If the form parameter name is present without any values, the injected list is empty.

Declarative clients send every value from List<T> and send Optional<List<T>> only when the optional is present.

Declarative client values must not be null. Use Optional.empty() to omit optional values. Client list values must not contain null elements.

  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Name of the form parameter.
  • Element Details

    • value

      String value
      Name of the form parameter.
      Returns:
      name of the form parameter