Skip to main content

HTTPClientConfig

This class encapsulates common settings that can be applied to an HTTP Client. It allows configuration of headers, timeouts, and various transport settings such as maximum idle connections and connection timeouts.

Attributes

AttributeTypeDescription
Headersmap[string][]stringSets http headers to set on the http client.
Timeoutconfig.DurationSets time out on the http client.
MaxIdleConnsintMaximum number of idle connections across all hosts. Zero means use the http.DefaultTransport value.
MaxIdleConnsPerHostintMaximum number of idle connections per host. Zero means use the http.DefaultTransport value.
MaxConnsPerHostintMaximum number of connections per host; new requests block at the limit. Zero means no limit.
IdleConnTimeoutconfig.DurationMaximum amount of time an idle connection remains open. Zero means use the http.DefaultTransport value.

Constructor

Signature

def HTTPClientConfig(
Headers: map[string][]string,
Timeout: config.Duration,
MaxIdleConns: int,
MaxIdleConnsPerHost: int,
MaxConnsPerHost: int,
IdleConnTimeout: config.Duration
) - > null

Parameters

NameTypeDescription
Headersmap[string][]stringSets http headers to set on the http client.
Timeoutconfig.DurationSets time out on the http client.
MaxIdleConnsintMaximum number of idle connections across all hosts. Zero means use the http.DefaultTransport value.
MaxIdleConnsPerHostintMaximum number of idle connections per host. Zero means use the http.DefaultTransport value.
MaxConnsPerHostintMaximum number of connections per host; new requests block at the limit. Zero means no limit.
IdleConnTimeoutconfig.DurationMaximum amount of time an idle connection remains open. Zero means use the http.DefaultTransport value.