Annotation Interface HeaderParam


@Target(PARAMETER) @Retention(SOURCE) public @interface HeaderParam
Binds a method parameter to an HTTP request header value. The value is converted from its string form to the parameter's declared type.

Usage:


 public String handle(@HeaderParam("X-Auth-Token") String token) { ... }
 
See Also:
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The name of the HTTP header to bind.
  • Element Details

    • value

      String value
      The name of the HTTP header to bind. Unlike PathParam and QueryParam, this is required — header names are rarely valid Java identifiers, so there is no fallback to the parameter name.
      Returns:
      the header name