HttpClientBuilderExtensions HttpClientBuilderExtensions HttpClientBuilderExtensions Class

Definition

Extension methods for configuring an IHttpClientBuilder

public static class HttpClientBuilderExtensions
type HttpClientBuilderExtensions = class
Public Module HttpClientBuilderExtensions
Inheritance
HttpClientBuilderExtensionsHttpClientBuilderExtensionsHttpClientBuilderExtensions

Methods

AddHttpMessageHandler(IHttpClientBuilder, Func<IServiceProvider,DelegatingHandler>) AddHttpMessageHandler(IHttpClientBuilder, Func<IServiceProvider,DelegatingHandler>) AddHttpMessageHandler(IHttpClientBuilder, Func<IServiceProvider,DelegatingHandler>)

Adds a delegate that will be used to create an additional message handler for a named HttpClient.

AddHttpMessageHandler(IHttpClientBuilder, Func<DelegatingHandler>) AddHttpMessageHandler(IHttpClientBuilder, Func<DelegatingHandler>) AddHttpMessageHandler(IHttpClientBuilder, Func<DelegatingHandler>)

Adds a delegate that will be used to create an additional message handler for a named HttpClient.

AddHttpMessageHandler<THandler>(IHttpClientBuilder) AddHttpMessageHandler<THandler>(IHttpClientBuilder) AddHttpMessageHandler<THandler>(IHttpClientBuilder)

Adds an additional message handler from the dependency injection container for a named HttpClient.

AddTypedClient<TClient,TImplementation>(IHttpClientBuilder) AddTypedClient<TClient,TImplementation>(IHttpClientBuilder) AddTypedClient<TClient,TImplementation>(IHttpClientBuilder)

Configures a binding between the TClient type and the named HttpClient associated with the IHttpClientBuilder. The created instances will be of type TImplementation.

AddTypedClient<TClient>(IHttpClientBuilder) AddTypedClient<TClient>(IHttpClientBuilder) AddTypedClient<TClient>(IHttpClientBuilder)

Configures a binding between the TClient type and the named HttpClient associated with the IHttpClientBuilder.

AddTypedClient<TClient>(IHttpClientBuilder, Func<HttpClient,IServiceProvider,TClient>) AddTypedClient<TClient>(IHttpClientBuilder, Func<HttpClient,IServiceProvider,TClient>) AddTypedClient<TClient>(IHttpClientBuilder, Func<HttpClient,IServiceProvider,TClient>)

Configures a binding between the TClient type and the named HttpClient associated with the IHttpClientBuilder.

AddTypedClient<TClient>(IHttpClientBuilder, Func<HttpClient,TClient>) AddTypedClient<TClient>(IHttpClientBuilder, Func<HttpClient,TClient>) AddTypedClient<TClient>(IHttpClientBuilder, Func<HttpClient,TClient>)

Configures a binding between the TClient type and the named HttpClient associated with the IHttpClientBuilder.

ConfigureHttpClient(IHttpClientBuilder, Action<IServiceProvider,HttpClient>) ConfigureHttpClient(IHttpClientBuilder, Action<IServiceProvider,HttpClient>) ConfigureHttpClient(IHttpClientBuilder, Action<IServiceProvider,HttpClient>)

Adds a delegate that will be used to configure a named HttpClient.

ConfigureHttpClient(IHttpClientBuilder, Action<HttpClient>) ConfigureHttpClient(IHttpClientBuilder, Action<HttpClient>) ConfigureHttpClient(IHttpClientBuilder, Action<HttpClient>)

Adds a delegate that will be used to configure a named HttpClient.

ConfigureHttpMessageHandlerBuilder(IHttpClientBuilder, Action<HttpMessageHandlerBuilder>) ConfigureHttpMessageHandlerBuilder(IHttpClientBuilder, Action<HttpMessageHandlerBuilder>) ConfigureHttpMessageHandlerBuilder(IHttpClientBuilder, Action<HttpMessageHandlerBuilder>)

Adds a delegate that will be used to configure message handlers using HttpMessageHandlerBuilder for a named HttpClient.

ConfigurePrimaryHttpMessageHandler(IHttpClientBuilder, Func<IServiceProvider,HttpMessageHandler>) ConfigurePrimaryHttpMessageHandler(IHttpClientBuilder, Func<IServiceProvider,HttpMessageHandler>) ConfigurePrimaryHttpMessageHandler(IHttpClientBuilder, Func<IServiceProvider,HttpMessageHandler>)

Adds a delegate that will be used to configure the primary HttpMessageHandler for a named HttpClient.

ConfigurePrimaryHttpMessageHandler(IHttpClientBuilder, Func<HttpMessageHandler>) ConfigurePrimaryHttpMessageHandler(IHttpClientBuilder, Func<HttpMessageHandler>) ConfigurePrimaryHttpMessageHandler(IHttpClientBuilder, Func<HttpMessageHandler>)

Adds a delegate that will be used to configure the primary HttpMessageHandler for a named HttpClient.

ConfigurePrimaryHttpMessageHandler<THandler>(IHttpClientBuilder) ConfigurePrimaryHttpMessageHandler<THandler>(IHttpClientBuilder) ConfigurePrimaryHttpMessageHandler<THandler>(IHttpClientBuilder)

Configures the primary HttpMessageHandler from the dependency injection container for a named HttpClient.

SetHandlerLifetime(IHttpClientBuilder, TimeSpan) SetHandlerLifetime(IHttpClientBuilder, TimeSpan) SetHandlerLifetime(IHttpClientBuilder, TimeSpan)

Sets the length of time that a HttpMessageHandler instance can be reused. Each named client can have its own configured handler lifetime value. The default value is two minutes. Set the lifetime to InfiniteTimeSpan to disable handler expiry.

Applies to