SocketsHttpHandlerBuilderExtensions.Configure 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
Configure(ISocketsHttpHandlerBuilder, IConfiguration)
使用 IConfiguration 为名为 HttpClient的 配置主SocketsHttpHandler数据库。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::ISocketsHttpHandlerBuilder ^ Configure(Microsoft::Extensions::DependencyInjection::ISocketsHttpHandlerBuilder ^ builder, Microsoft::Extensions::Configuration::IConfiguration ^ configuration);
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public static Microsoft.Extensions.DependencyInjection.ISocketsHttpHandlerBuilder Configure (this Microsoft.Extensions.DependencyInjection.ISocketsHttpHandlerBuilder builder, Microsoft.Extensions.Configuration.IConfiguration configuration);
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
static member Configure : Microsoft.Extensions.DependencyInjection.ISocketsHttpHandlerBuilder * Microsoft.Extensions.Configuration.IConfiguration -> Microsoft.Extensions.DependencyInjection.ISocketsHttpHandlerBuilder
<Extension()>
Public Function Configure (builder As ISocketsHttpHandlerBuilder, configuration As IConfiguration) As ISocketsHttpHandlerBuilder
参数
- configuration
- IConfiguration
包含 属性的配置 SocketsHttpHandler。
返回
ISocketsHttpHandlerBuilder可用于配置处理程序的 。
- 属性
注解
仅分析 、int
、 Enum或 TimeSpan 类型的bool
属性SocketsHttpHandler。
中 IConfiguration 所有不匹配的属性将被忽略。
适用于
Configure(ISocketsHttpHandlerBuilder, Action<SocketsHttpHandler,IServiceProvider>)
添加一个委托,该委托将为已命名的 HttpClient 配置主要 SocketsHttpHandler。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::ISocketsHttpHandlerBuilder ^ Configure(Microsoft::Extensions::DependencyInjection::ISocketsHttpHandlerBuilder ^ builder, Action<System::Net::Http::SocketsHttpHandler ^, IServiceProvider ^> ^ configure);
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public static Microsoft.Extensions.DependencyInjection.ISocketsHttpHandlerBuilder Configure (this Microsoft.Extensions.DependencyInjection.ISocketsHttpHandlerBuilder builder, Action<System.Net.Http.SocketsHttpHandler,IServiceProvider> configure);
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
static member Configure : Microsoft.Extensions.DependencyInjection.ISocketsHttpHandlerBuilder * Action<System.Net.Http.SocketsHttpHandler, IServiceProvider> -> Microsoft.Extensions.DependencyInjection.ISocketsHttpHandlerBuilder
<Extension()>
Public Function Configure (builder As ISocketsHttpHandlerBuilder, configure As Action(Of SocketsHttpHandler, IServiceProvider)) As ISocketsHttpHandlerBuilder
参数
- configure
- Action<SocketsHttpHandler,IServiceProvider>
用于修改 的 SocketsHttpHandler委托。
返回
ISocketsHttpHandlerBuilder可用于配置处理程序的 。
- 属性