setHandlerLifetime method

HttpClientBuilder setHandlerLifetime(
  1. Duration lifetime
)

Sets the handler lifetime for this HTTP client.

The handler will be recreated after the specified duration. A zero or negative duration disables expiration.

Implementation

HttpClientBuilder setHandlerLifetime(Duration lifetime) {
  services.configure<HttpClientFactoryOptions>(
    HttpClientFactoryOptions.new,
    (options) => options.handlerLifetime = lifetime,
    name: name,
  );
  return this;
}