com.holonplatform.http.rest

## Interface RestClientOperations<C extends RestClientOperations<C,R>,R extends RestClientOperations.RequestConfiguration<R> & RestClientOperations.InvocationOperations>

- Type Parameters:
    `C` - Concrete REST client operations type
    `R` - Concrete Request API type
  All Known Subinterfaces:
    AsyncRestClient, RestClient, SpringRestClient
  All Known Implementing Classes:
    AbstractAsyncRestClient

      public interface RestClientOperations<C extends RestClientOperations<C,R>,R extends RestClientOperations.RequestConfiguration<R> & RestClientOperations.InvocationOperations>

  Base API for REST client operations definitions.
  Since:
    5.2.0

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `RestClientOperations.InvocationOperations<RE,RP,RS,RL,RU>` Invocantion operations definitions.
    `static interface` | `RestClientOperations.RequestConfiguration<R extends RestClientOperations.RequestConfiguration<R>>` Request configuration builder.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `C` | `clearDefaultHeaders()` Removes all default headers
    `C` | `defaultTarget(URI baseUri)` Set the default target request base URI, which will be used as target URI for every request configured using `request()`, if not overridden using `RestClientOperations.RequestConfiguration.target(URI)`.
    `Optional<URI>` | `getDefaultTarget()` Get the default target request base URI, which will be used as target URI for every request configured using `request()`, if not overridden using `RestClientOperations.RequestConfiguration.target(URI)`.
    `C` | `removeDefaultHeader(String name)` Removes the default header with given `name`, if present
    `R` | `request()` Create a new request definition, to be used to configure request and invoke response.
    `C` | `withDefaultHeader(String name, String value)` Add a default request header which will be automatically added to every invocation request message, if an header with the same name is not already present.

- - ### Method Detail

    - #### defaultTarget

          C defaultTarget(URI baseUri)

      Set the default target request base URI, which will be used as target URI for every request configured using `request()`, if not overridden using `RestClientOperations.RequestConfiguration.target(URI)`.

      URI template parameters are not supported for the base target URI.

      Parameters:
        `baseUri` - Default target request base URI
      Returns:
        The updated RestClient

    - #### getDefaultTarget

          Optional<URI> getDefaultTarget()

      Get the default target request base URI, which will be used as target URI for every request configured using `request()`, if not overridden using `RestClientOperations.RequestConfiguration.target(URI)`.
      Returns:
        Default target request base URI, if setted

    - #### withDefaultHeader

          C withDefaultHeader(String name,
                              String value)

      Add a default request header which will be automatically added to every invocation request message, if an header with the same name is not already present.
      Parameters:
        `name` - Header name (not null)
        `value` - Header value
      Returns:
        The updated RestClient

    - #### removeDefaultHeader

          C removeDefaultHeader(String name)

      Removes the default header with given `name`, if present
      Parameters:
        `name` - Header name to remove (not null)
      Returns:
        The updated RestClient

    - #### clearDefaultHeaders

          C clearDefaultHeaders()

      Removes all default headers
      Returns:
        The updated RestClient

    - #### request

          R request()

      Create a new request definition, to be used to configure request and invoke response.

      If a default target request URI is configured using `defaultTarget(URI)`, this will be used as request base URI. The target URI can be overridden using `RestClientOperations.RequestConfiguration.target(URI)`.

      Returns:
        Request definition builder

Copyright © 2019 The Holon Platform. All rights reserved.