Interface WebClientConfig

All Superinterfaces:
HttpClientConfig, HttpConfigBase, Prototype.Api, Prototype.Factory<WebClient>
All Known Implementing Classes:
WebClientConfig.BuilderBase.WebClientConfigImpl

public interface WebClientConfig extends Prototype.Api, HttpClientConfig, HttpConfigBase
WebClient configuration.
See Also:
  • Method Details

    • builder

      static WebClientConfig.Builder builder()
      Create a new fluent API builder to customize configuration.
      Returns:
      a new builder
    • builder

      static WebClientConfig.Builder builder(WebClientConfig instance)
      Create a new fluent API builder from an existing instance.
      Parameters:
      instance - an existing instance used as a base for the builder
      Returns:
      a builder based on an instance
    • create

      static WebClientConfig create(Config config)
      Create a new instance from configuration.
      Parameters:
      config - used to configure the new instance
      Returns:
      a new instance configured from configuration
    • create

      @Deprecated static WebClientConfig create(Config config)
      Create a new instance from configuration.
      Parameters:
      config - used to configure the new instance
      Returns:
      a new instance configured from configuration
    • create

      static WebClientConfig create()
      Create a new instance with default values.
      Returns:
      a new instance
    • protocolConfigs

      List<ProtocolConfig> protocolConfigs()
      Configuration of client protocols.
      Returns:
      client protocol configurations
    • protocolPreference

      List<String> protocolPreference()
      List of HTTP protocol IDs by order of preference. If left empty, all discovered providers will be used, ordered by weight.

      For example if both HTTP/2 and HTTP/1.1 providers are available (considering HTTP/2 has higher weights), for ALPN we will send h2 and http/1.1 and decide based on response. If TLS is not used, we would attempt an upgrade (or use prior knowledge if configured in protocolConfigs()).

      Returns:
      list of HTTP protocol IDs in order of preference
    • defaultRequestHeaders

      default ClientRequestHeaders defaultRequestHeaders()
      Default headers as a headers object. Creates a new instance for each call, so the returned value can be safely mutated.
      Returns:
      default headers