HttpClientBuilderExtensions.ConfigureHttpClient 方法

定义

重载

ConfigureHttpClient(IHttpClientBuilder, Action<HttpClient>)

添加用于配置已命名的 HttpClient 的委托。

ConfigureHttpClient(IHttpClientBuilder, Action<IServiceProvider,HttpClient>)

添加用于配置已命名的 HttpClient 的委托。

ConfigureHttpClient(IHttpClientBuilder, Action<HttpClient>)

Source:
HttpClientBuilderExtensions.cs
Source:
HttpClientBuilderExtensions.cs
Source:
HttpClientBuilderExtensions.cs
Source:
HttpClientBuilderExtensions.cs
Source:
HttpClientBuilderExtensions.cs

添加用于配置已命名的 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

参数

configureClient
Action<HttpClient>

用于配置 HttpClient 的委托。

返回

可用于配置客户端的 IHttpClientBuilder

适用于

ConfigureHttpClient(IHttpClientBuilder, Action<IServiceProvider,HttpClient>)

Source:
HttpClientBuilderExtensions.cs
Source:
HttpClientBuilderExtensions.cs
Source:
HttpClientBuilderExtensions.cs
Source:
HttpClientBuilderExtensions.cs
Source:
HttpClientBuilderExtensions.cs

添加用于配置已命名的 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

参数

configureClient
Action<IServiceProvider,HttpClient>

用于配置 HttpClient 的委托。

返回

可用于配置客户端的 IHttpClientBuilder

注解

IServiceProvider提供给 configureClient 的 将是同一应用程序的根服务提供程序实例。

适用于