HttpClientFactoryOptions 类

定义

用于配置默认的 IHttpClientFactory 的选项类。An options class for configuring the default IHttpClientFactory.

public ref class HttpClientFactoryOptions
public class HttpClientFactoryOptions
type HttpClientFactoryOptions = class
Public Class HttpClientFactoryOptions
继承
HttpClientFactoryOptions

构造函数

HttpClientFactoryOptions()

属性

HandlerLifetime

获取或设置可重复使用 HttpMessageHandler 实例的时间长度。Gets or sets the length of time that a HttpMessageHandler instance can be reused. 每个已命名的客户端都可自行配置处理程序生存期值。Each named client can have its own configured handler lifetime value. 此属性的默认值为 2 分钟。The default value of this property is two minutes. 将生存期设置为 InfiniteTimeSpan 可禁用处理程序到期。Set the lifetime to InfiniteTimeSpan to disable handler expiry.

HttpClientActions

获取用于配置 HttpClient 的操作列表。Gets a list of operations used to configure an HttpClient.

HttpMessageHandlerBuilderActions

获取用于配置 HttpMessageHandlerBuilder 的操作列表。Gets a list of operations used to configure an HttpMessageHandlerBuilder.

ShouldRedactHeaderValue

用于确定是否在记录之前修正 HTTP 标头值的委托。The delegate which determines whether to redact the HTTP header value before logging.

SuppressHandlerScope

获取或设置一个值,该值确定在生成 HttpMessageHandler 时,IHttpClientFactory 是否将创建依赖项注入范围。Gets or sets a value that determines whether the IHttpClientFactory will create a dependency injection scope when building an HttpMessageHandler. 如果为 false(默认值),则将创建一个范围,否则将不会创建范围。If false (default), a scope will be created, otherwise a scope will not be created.

提供此选项是为了与现有应用程序兼容。This option is provided for compatibility with existing applications. 建议为新应用程序使用默认设置。It is recommended to use the default setting for new applications.

方法

Equals(Object)

确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)

适用于