HttpClientBuilderExtensions.ConfigureHttpClient Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
ConfigureHttpClient(IHttpClientBuilder, Action<HttpClient>) |
Adds a delegate that will be used to configure a named HttpClient. |
ConfigureHttpClient(IHttpClientBuilder, Action<IServiceProvider,HttpClient>) |
Adds a delegate that will be used to configure a named HttpClient. |
ConfigureHttpClient(IHttpClientBuilder, Action<HttpClient>)
Adds a delegate that will be used to configure a named 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
Parameters
- builder
- IHttpClientBuilder
The IHttpClientBuilder.
- configureClient
- Action<HttpClient>
A delegate that is used to configure an HttpClient.
Returns
An IHttpClientBuilder that can be used to configure the client.
Applies to
ConfigureHttpClient(IHttpClientBuilder, Action<IServiceProvider,HttpClient>)
Adds a delegate that will be used to configure a named 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
Parameters
- builder
- IHttpClientBuilder
The IHttpClientBuilder.
- configureClient
- Action<IServiceProvider,HttpClient>
A delegate that is used to configure an HttpClient.
Returns
An IHttpClientBuilder that can be used to configure the client.
Remarks
The IServiceProvider provided to configureClient
will be the same application's root service provider instance.
Applies to
.NET