Skip to main content

get_or_init_global_http_client

Function get_or_init_global_http_client 

Source
pub fn get_or_init_global_http_client() -> Result<Arc<ClientWithMiddleware>>
Expand description

Get or initialize the global HTTP client with default config

This is a convenience function for use cases where the client might not be explicitly initialized. It uses default performance config.

§Errors

Returns an error if HTTP client creation fails (e.g., TLS initialization error). This function is thread-safe and ensures only one thread performs initialization.