Interface RestClientBuilder

    • Method Detail

      • baseUrl

        RestClientBuilder baseUrl​( url)
        Specifies the base URL to be used when making requests. Assuming that the interface has a @Path("/api") at the interface level and a url is given with http://my-service:8080/service then all REST calls will be invoked with a url of http://my-service:8080/service/api in addition to any @Path annotations included on the method.
        url - the base Url for the service.
        the current builder with the baseUrl set
      • build

        <T> T build​(java.lang.Class<T> clazz)
             throws java.lang.IllegalStateException,
        Based on the configured RestClientBuilder, creates a new instance of the given REST interface to invoke API calls against.
        Type Parameters:
        T - the type of the interface
        clazz - the interface that defines REST API methods for use
        a new instance of an implementation of this REST interface that
        java.lang.IllegalStateException - if not all pre-requisites are satisfied for the builder, this exception may get thrown. For instance, if a URL has not been set.
        RestClientDefinitionException - if the passed-in interface class is invalid.