Annotation Type BaseUrl


@Documented @Retention(RUNTIME) @Target(TYPE) public @interface BaseUrl
Declares the base URL for every relative method URL on a @RestClient interface, so @GET/@POST/etc. can use a path (e.g. "/items/{id}") instead of repeating the full URL on every method.

A method URL that is already absolute (starts with http:// or https://) is used as-is and ignores @BaseUrl - a method can always opt out of the interface's base URL by giving its own full one. A relative method URL on an interface with no @BaseUrl fails validation, since there would be nothing to resolve it against.

  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The base URL, e.g.
  • Element Details

    • value

      String value
      The base URL, e.g. "https://api.example.com". May itself contain a {placeholder} substituted by a matching @PathParam, the same as a method URL.
      Returns:
      the base URL