共用方式為


HttpClientBuilderExtensions.ConfigureHttpClient 方法

定義

多載

ConfigureHttpClient(IHttpClientBuilder, Action<HttpClient>)

新增將用於設定具名 HttpClient 的委派。

ConfigureHttpClient(IHttpClientBuilder, Action<IServiceProvider,HttpClient>)

新增將用於設定具名 HttpClient 的委派。

ConfigureHttpClient(IHttpClientBuilder, Action<HttpClient>)

來源:
HttpClientBuilderExtensions.cs
來源:
HttpClientBuilderExtensions.cs
來源:
HttpClientBuilderExtensions.cs
來源:
HttpClientBuilderExtensions.cs
來源:
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>)

來源:
HttpClientBuilderExtensions.cs
來源:
HttpClientBuilderExtensions.cs
來源:
HttpClientBuilderExtensions.cs
來源:
HttpClientBuilderExtensions.cs
來源:
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

備註

提供給 configureClientIServiceProvider 會是相同應用程式的根服務提供者實例。

適用於