com.holonplatform.http.rest

## Interface RestClient

- All Superinterfaces:
    RestClientOperations<RestClient,RestClient.RequestDefinition>
  All Known Subinterfaces:
    SpringRestClient

      public interface RestClient
      extends RestClientOperations<RestClient,RestClient.RequestDefinition>

  HTTP REST client to build and execute client requests in order to consume the responses returned.
  Since:
    5.0.0

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `RestClient.Invocation` Invocation operations
    `static interface` | `RestClient.RequestDefinition` Request message definition and response invocation.

    - ### Nested classes/interfaces inherited from interface com.holonplatform.http.rest.RestClientOperations

      `RestClientOperations.InvocationOperations<RE,RP,RS,RL,RU>, RestClientOperations.RequestConfiguration<R extends RestClientOperations.RequestConfiguration<R>>`

  - ### Method Summary

    All Methods Static Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `static RestClient` | `create()` Create a new `RestClient` instance using default `ClassLoader` and default implementation, if available.
    `static RestClient` | `create(ClassLoader classLoader)` Create a new `RestClient` instance using given `classLoder` and default implementation, if available.
    `static RestClient` | `create(String fullyQualifiedClassName)` Create a new `RestClient` instance using default `ClassLoader` and the implementation whith given fully qualified class name.
    `static RestClient` | `create(String fullyQualifiedClassName, ClassLoader classLoader)` Create a new `RestClient` instance using given `classLoder` and the implementation whith given fully qualified class name.
    `static RestClient` | `forTarget(String baseUri)` Create a new `RestClient` instance using default `ClassLoader` and default implementation, setting given `baseUri` as default `RestClient` target, which will be used as base URI for every request configured using `RestClientOperations.request()`, if not overridden using `RestClientOperations.RequestConfiguration.target(URI)`.
    `static RestClient` | `forTarget(URI baseUri)` Create a new `RestClient` instance using default `ClassLoader` and default implementation, setting given `baseUri` as default `RestClient` target, which will be used as base URI for every request configured using `RestClientOperations.request()`, if not overridden using `RestClientOperations.RequestConfiguration.target(URI)`.

    - ### Methods inherited from interface com.holonplatform.http.rest.RestClientOperations

      `clearDefaultHeaders, defaultTarget, getDefaultTarget, removeDefaultHeader, request, withDefaultHeader`

- - ### Method Detail

    - #### forTarget

          static RestClient forTarget(String baseUri)

      Create a new `RestClient` instance using default `ClassLoader` and default implementation, setting given `baseUri` as default `RestClient` target, which will be used as base URI for every request configured using `RestClientOperations.request()`, if not overridden using `RestClientOperations.RequestConfiguration.target(URI)`.
      Parameters:
        `baseUri` - The base target URI of the returned `RestClient`
      Returns:
        A new `RestClient` instance

    - #### forTarget

          static RestClient forTarget(URI baseUri)

      Create a new `RestClient` instance using default `ClassLoader` and default implementation, setting given `baseUri` as default `RestClient` target, which will be used as base URI for every request configured using `RestClientOperations.request()`, if not overridden using `RestClientOperations.RequestConfiguration.target(URI)`.
      Parameters:
        `baseUri` - The base target URI of the returned `RestClient`
      Returns:
        A new `RestClient` instance

    - #### create

          static RestClient create()

      Create a new `RestClient` instance using default `ClassLoader` and default implementation, if available. If more than one `RestClient` implementation is found using given ClassLoader, the one returned by the `RestClientFactory` with the higher priority is returned.
      Returns:
        A new `RestClient` instance
      Throws:
        `RestClientCreationException` - If a `RestClient` implementation is not available or a instance creation error occurred

    - #### create

          static RestClient create(ClassLoader classLoader)

      Create a new `RestClient` instance using given `classLoder` and default implementation, if available. If more than one `RestClient` implementation is found using given ClassLoader, the one returned by the `RestClientFactory` with the higher priority is returned.
      Parameters:
        `classLoader` - The `ClassLoader` to use
      Returns:
        A new `RestClient` instance
      Throws:
        `RestClientCreationException` - If a `RestClient` implementation is not available or a instance creation error occurred

    - #### create

          static RestClient create(String fullyQualifiedClassName)

      Create a new `RestClient` instance using default `ClassLoader` and the implementation whith given fully qualified class name.
      Parameters:
        `fullyQualifiedClassName` - The `RestClient` implementation fully qualified class name to obtain
      Returns:
        A new `RestClient` instance
      Throws:
        `RestClientCreationException` - If the implementation which corresponds to given fully qualified class name is not available or a instance creation error occurred

    - #### create

          static RestClient create(String fullyQualifiedClassName,
                                   ClassLoader classLoader)

      Create a new `RestClient` instance using given `classLoder` and the implementation whith given fully qualified class name.
      Parameters:
        `fullyQualifiedClassName` - The `RestClient` implementation fully qualified class name to obtain
        `classLoader` - The `ClassLoader` to use
      Returns:
        A new `RestClient` instance
      Throws:
        `RestClientCreationException` - If the implementation which corresponds to given fully qualified class name is not available or a instance creation error occurred

Copyright © 2019 The Holon Platform. All rights reserved.