Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
HttpClientBuilderExtensions.ConfigureHttpClient Method
Definition
- Namespace:
- Microsoft.Extensions.DependencyInjection
- Assembly:
- Microsoft.Extensions.Http.dll
- Package:
- Microsoft.Extensions.Http v11.0.0-preview.5.26302.115
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
| Name | Description |
|---|---|
| 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
Feedback
Was this page helpful?
