HttpClientBuilderExtensions.ConfigureHttpClient 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
ConfigureHttpClient(IHttpClientBuilder, Action<HttpClient>) |
添加用于配置已命名的 HttpClient 的委托。 |
ConfigureHttpClient(IHttpClientBuilder, Action<IServiceProvider,HttpClient>) |
添加用于配置已命名的 HttpClient 的委托。 |
ConfigureHttpClient(IHttpClientBuilder, Action<HttpClient>)
添加用于配置已命名的 HttpClient 的委托。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ ConfigureHttpClient(Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ builder, Action<System::Net::Http::HttpClient ^> ^ configureClient);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder ConfigureHttpClient (this Microsoft.Extensions.DependencyInjection.IHttpClientBuilder builder, Action<System.Net.Http.HttpClient> configureClient);
static member ConfigureHttpClient : Microsoft.Extensions.DependencyInjection.IHttpClientBuilder * Action<System.Net.Http.HttpClient> -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder
<Extension()>
Public Function ConfigureHttpClient (builder As IHttpClientBuilder, configureClient As Action(Of HttpClient)) As IHttpClientBuilder
参数
- builder
- IHttpClientBuilder
- configureClient
- Action<HttpClient>
用于配置 HttpClient 的委托。
返回
可用于配置客户端的 IHttpClientBuilder。
适用于
ConfigureHttpClient(IHttpClientBuilder, Action<IServiceProvider,HttpClient>)
添加用于配置已命名的 HttpClient 的委托。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ ConfigureHttpClient(Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ builder, Action<IServiceProvider ^, System::Net::Http::HttpClient ^> ^ configureClient);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder ConfigureHttpClient (this Microsoft.Extensions.DependencyInjection.IHttpClientBuilder builder, Action<IServiceProvider,System.Net.Http.HttpClient> configureClient);
static member ConfigureHttpClient : Microsoft.Extensions.DependencyInjection.IHttpClientBuilder * Action<IServiceProvider, System.Net.Http.HttpClient> -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder
<Extension()>
Public Function ConfigureHttpClient (builder As IHttpClientBuilder, configureClient As Action(Of IServiceProvider, HttpClient)) As IHttpClientBuilder
参数
- builder
- IHttpClientBuilder
- configureClient
- Action<IServiceProvider,HttpClient>
用于配置 HttpClient 的委托。
返回
可用于配置客户端的 IHttpClientBuilder。
注解
IServiceProvider提供给 configureClient
的 将是同一应用程序的根服务提供程序实例。