Package feign

Interface Target<T>

  • Type Parameters:
    T - type of the interface this target applies to.
    All Known Implementing Classes:
    Target.EmptyTarget, Target.HardCodedTarget

    public interface Target<T>


    relationship to JAXRS 2.0

    Similar to javax.ws.rs.client.WebTarget, as it produces requests. However, RequestTemplate is a closer match to WebTarget.
    • Method Detail

      • type

        java.lang.Class<T> type()
      • name

        java.lang.String name()
      • url

        java.lang.String url()
      • apply

        Request apply​(RequestTemplate input)
        Targets a template to this target, adding the base url and any target-specific headers or query parameters.

        For example:
         public Request apply(RequestTemplate input) {
           input.insert(0, url());
           input.replaceHeader("X-Auth", currentToken);
           return input.asRequest();
         }
         



        relationship to JAXRS 2.0

        This call is similar to javax.ws.rs.client.WebTarget.request(), except that we expect transient, but necessary decoration to be applied on invocation.