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
| Attribute | Type | Description |
|---|---|---|
| Headers | map[string][]string | Sets http headers to set on the http client. |
| Timeout | config.Duration | Sets time out on the http client. |
| MaxIdleConns | int | Maximum number of idle connections across all hosts. Zero means use the http.DefaultTransport value. |
| MaxIdleConnsPerHost | int | Maximum number of idle connections per host. Zero means use the http.DefaultTransport value. |
| MaxConnsPerHost | int | Maximum number of connections per host; new requests block at the limit. Zero means no limit. |
| IdleConnTimeout | config.Duration | Maximum 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
| Name | Type | Description |
|---|---|---|
| Headers | map[string][]string | Sets http headers to set on the http client. |
| Timeout | config.Duration | Sets time out on the http client. |
| MaxIdleConns | int | Maximum number of idle connections across all hosts. Zero means use the http.DefaultTransport value. |
| MaxIdleConnsPerHost | int | Maximum number of idle connections per host. Zero means use the http.DefaultTransport value. |
| MaxConnsPerHost | int | Maximum number of connections per host; new requests block at the limit. Zero means no limit. |
| IdleConnTimeout | config.Duration | Maximum amount of time an idle connection remains open. Zero means use the http.DefaultTransport value. |