Class ApacheHttpClient5Options.Builder

    • Method Detail

      • addHeader

        public ApacheHttpClient5Options.Builder addHeader​(java.lang.String name,
                                                          java.lang.String value)
        Add the provided header to the request.
        Specified by:
        addHeader in interface TransportOptions.Builder
        Parameters:
        name - the header name
        value - the header value
        Throws:
        java.lang.NullPointerException - if name or value is null.
      • onWarnings

        public TransportOptions.Builder onWarnings​(java.util.function.Function<java.util.List<java.lang.String>,​java.lang.Boolean> listener)
        Called if there are warnings to determine if those warnings should fail the request.
        Specified by:
        onWarnings in interface TransportOptions.Builder
      • setHttpAsyncResponseConsumerFactory

        public void setHttpAsyncResponseConsumerFactory​(HttpAsyncResponseConsumerFactory httpAsyncResponseConsumerFactory)
        Set the HttpAsyncResponseConsumerFactory used to create one AsyncResponseConsumer callback per retry. Controls how the response body gets streamed from a non-blocking HTTP connection on the client side.
        Parameters:
        httpAsyncResponseConsumerFactory - factory for creating AsyncResponseConsumer.
        Throws:
        java.lang.NullPointerException - if httpAsyncResponseConsumerFactory is null.
      • setWarningsHandler

        public void setWarningsHandler​(WarningsHandler warningsHandler)
        How this request should handle warnings. If null (the default) then this request will default to the behavior dictacted by `setStrictDeprecationMode`.

        This can be set to WarningsHandler.PERMISSIVE if the client should ignore all warnings which is the same behavior as setting strictDeprecationMode to true. It can be set to WarningsHandler.STRICT if the client should fail if there are any warnings which is the same behavior as settings strictDeprecationMode to false.

        It can also be set to a custom implementation of WarningsHandler to permit only certain warnings or to fail the request if the warnings returned don't exactly match some set.

        Parameters:
        warningsHandler - the WarningsHandler to be used
      • setRequestConfig

        public ApacheHttpClient5Options.Builder setRequestConfig​(org.apache.hc.client5.http.config.RequestConfig requestConfig)
        set RequestConfig, which can set socketTimeout, connectTimeout and so on by request
        Parameters:
        requestConfig - http client RequestConfig
        Returns:
        Builder