Compartir a través de


HttpClientBuilderExtensions.ConfigureHttpClient Método

Definición

Sobrecargas

ConfigureHttpClient(IHttpClientBuilder, Action<HttpClient>)

Agrega un delegado que se usará para configurar un objeto HttpClient con nombre.

ConfigureHttpClient(IHttpClientBuilder, Action<IServiceProvider,HttpClient>)

Agrega un delegado que se usará para configurar un objeto HttpClient con nombre.

ConfigureHttpClient(IHttpClientBuilder, Action<HttpClient>)

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

Agrega un delegado que se usará para configurar un objeto HttpClient con nombre.

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>

Un delegado que se usa para configurar un objeto HttpClient.

Devoluciones

Un objeto IHttpClientBuilder que se puede usar para configurar el cliente.

Se aplica a

ConfigureHttpClient(IHttpClientBuilder, Action<IServiceProvider,HttpClient>)

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

Agrega un delegado que se usará para configurar un objeto HttpClient con nombre.

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>

Un delegado que se usa para configurar un objeto HttpClient.

Devoluciones

Un objeto IHttpClientBuilder que se puede usar para configurar el cliente.

Comentarios

El IServiceProvider proporcionado para configureClient será la misma instancia del proveedor de servicios raíz de la aplicación.

Se aplica a