Compartilhar via


HttpClientBuilderExtensions.ConfigureHttpClient Método

Definição

Sobrecargas

ConfigureHttpClient(IHttpClientBuilder, Action<HttpClient>)

Adiciona um delegado que será usado para configurar um HttpClient nomeado.

ConfigureHttpClient(IHttpClientBuilder, Action<IServiceProvider,HttpClient>)

Adiciona um delegado que será usado para configurar um HttpClient nomeado.

ConfigureHttpClient(IHttpClientBuilder, Action<HttpClient>)

Origem:
HttpClientBuilderExtensions.cs
Origem:
HttpClientBuilderExtensions.cs
Origem:
HttpClientBuilderExtensions.cs
Origem:
HttpClientBuilderExtensions.cs
Origem:
HttpClientBuilderExtensions.cs

Adiciona um delegado que será usado para configurar um HttpClient nomeado.

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

Parâmetros

configureClient
Action<HttpClient>

Um delegado usado para configurar um HttpClient.

Retornos

Um IHttpClientBuilder que pode ser usado para configurar o cliente.

Aplica-se a

ConfigureHttpClient(IHttpClientBuilder, Action<IServiceProvider,HttpClient>)

Origem:
HttpClientBuilderExtensions.cs
Origem:
HttpClientBuilderExtensions.cs
Origem:
HttpClientBuilderExtensions.cs
Origem:
HttpClientBuilderExtensions.cs
Origem:
HttpClientBuilderExtensions.cs

Adiciona um delegado que será usado para configurar um HttpClient nomeado.

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

Parâmetros

configureClient
Action<IServiceProvider,HttpClient>

Um delegado usado para configurar um HttpClient.

Retornos

Um IHttpClientBuilder que pode ser usado para configurar o cliente.

Comentários

O IServiceProvider fornecido para configureClient será a mesma instância do provedor de serviço raiz do aplicativo.

Aplica-se a