Skip to main content

build_default_http_client

Function build_default_http_client 

Source
pub fn build_default_http_client(
    _client_type: &str,
    require_tls: bool,
) -> Result<HttpClient, HttpError>
Expand description

Non-otel build of build_default_http_client: RED metrics (.with_metrics) are NOT compiled in — that builder method only exists under toolkit-http/otel. client_type is unused in this configuration. .with_otel() is still called (see the doc on the otel-cfg sibling above): whether it actually propagates traceparent depends on whether toolkit-http/otel ends up enabled by some crate in the build, not on this crate’s own otel feature.

§Errors

Propagates toolkit_http::HttpError from the underlying builder (e.g. a TLS backend that cannot be constructed under FIPS).