Annotation Type Headers


@Retention(RUNTIME) @Target({TYPE,METHOD}) public @interface Headers
Headers for an Http @Client interface method.

We can put this on a method or the interface to add preset headers to the generated implementation bean property.


 @Headers({
 "Accept: application/vnd.github.v3.full+json",
 "User-Agent: Avaje-Sample-App"
 })
 @Get("users/{username}")
 User getUser(@Path("username") String username);

 
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The array of headers
  • Element Details

    • value

      String[] value
      The array of headers