次の方法で共有


HttpClientFactoryServiceCollectionExtensions.AddHttpClient メソッド

定義

オーバーロード

AddHttpClient(IServiceCollection)

IHttpClientFactory および関連するサービスを IServiceCollectionに追加します。

AddHttpClient(IServiceCollection, String)

IHttpClientFactory および関連サービスを IServiceCollection に追加し、名前付き HttpClientを構成します。

AddHttpClient(IServiceCollection, String, Action<IServiceProvider,HttpClient>)

IHttpClientFactory および関連サービスを IServiceCollection に追加し、名前付き HttpClientを構成します。

AddHttpClient(IServiceCollection, String, Action<HttpClient>)

IHttpClientFactory および関連サービスを IServiceCollection に追加し、名前付き HttpClientを構成します。

AddHttpClient<TClient,TImplementation>(IServiceCollection, String, Func<HttpClient,IServiceProvider,TImplementation>)

IHttpClientFactory および関連サービスを IServiceCollection に追加し、TClient 型と名前付き HttpClientの間のバインディングを構成します。

AddHttpClient<TClient,TImplementation>(IServiceCollection, String, Action<HttpClient>)

IHttpClientFactory および関連サービスを IServiceCollection に追加し、TClient 型と名前付き HttpClientの間のバインディングを構成します。

AddHttpClient<TClient,TImplementation>(IServiceCollection, String, Action<IServiceProvider,HttpClient>)

IHttpClientFactory および関連サービスを IServiceCollection に追加し、TClient 型と名前付き HttpClientの間のバインディングを構成します。

AddHttpClient<TClient,TImplementation>(IServiceCollection, String)

IHttpClientFactory および関連サービスを IServiceCollection に追加し、TClient 型と名前付き HttpClientの間のバインディングを構成します。 クライアント名は、TClientの型名に設定されます。

AddHttpClient<TClient,TImplementation>(IServiceCollection, Func<HttpClient,TImplementation>)

IHttpClientFactory および関連サービスを IServiceCollection に追加し、TClient 型と名前付き HttpClientの間のバインディングを構成します。

AddHttpClient<TClient,TImplementation>(IServiceCollection, Func<HttpClient,IServiceProvider,TImplementation>)

IHttpClientFactory および関連サービスを IServiceCollection に追加し、TClient 型と名前付き HttpClientの間のバインディングを構成します。

AddHttpClient<TClient,TImplementation>(IServiceCollection, Action<HttpClient>)

IHttpClientFactory および関連サービスを IServiceCollection に追加し、TClient 型と名前付き HttpClientの間のバインディングを構成します。 クライアント名は、TClientの型名に設定されます。

AddHttpClient<TClient,TImplementation>(IServiceCollection)

IHttpClientFactory および関連サービスを IServiceCollection に追加し、TClient 型と名前付き HttpClientの間のバインディングを構成します。 クライアント名は、TClientの型名に設定されます。

AddHttpClient<TClient,TImplementation>(IServiceCollection, String, Func<HttpClient,TImplementation>)

IHttpClientFactory および関連サービスを IServiceCollection に追加し、TClient 型と名前付き HttpClientの間のバインディングを構成します。

AddHttpClient<TClient,TImplementation>(IServiceCollection, Action<IServiceProvider,HttpClient>)

IHttpClientFactory および関連サービスを IServiceCollection に追加し、TClient 型と名前付き HttpClientの間のバインディングを構成します。 クライアント名は、TClientの型名に設定されます。

AddHttpClient<TClient>(IServiceCollection, String, Action<HttpClient>)

IHttpClientFactory および関連サービスを IServiceCollection に追加し、TClient 型と名前付き HttpClientの間のバインディングを構成します。

AddHttpClient<TClient>(IServiceCollection, String, Action<IServiceProvider,HttpClient>)

IHttpClientFactory および関連サービスを IServiceCollection に追加し、TClient 型と名前付き HttpClientの間のバインディングを構成します。

AddHttpClient<TClient>(IServiceCollection, String)

IHttpClientFactory および関連サービスを IServiceCollection に追加し、TClient 型と名前付き HttpClientの間のバインディングを構成します。

AddHttpClient<TClient>(IServiceCollection, Action<HttpClient>)

IHttpClientFactory および関連サービスを IServiceCollection に追加し、TClient 型と名前付き HttpClientの間のバインディングを構成します。 クライアント名は、TClientの型名に設定されます。

AddHttpClient<TClient>(IServiceCollection, Action<IServiceProvider,HttpClient>)

IHttpClientFactory および関連サービスを IServiceCollection に追加し、TClient 型と名前付き HttpClientの間のバインディングを構成します。 クライアント名は、TClientの型名に設定されます。

AddHttpClient<TClient>(IServiceCollection)

IHttpClientFactory および関連サービスを IServiceCollection に追加し、TClient 型と名前付き HttpClientの間のバインディングを構成します。 クライアント名は、TClientの完全な名前に設定されます。

AddHttpClient(IServiceCollection)

ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs

IHttpClientFactory および関連するサービスを IServiceCollectionに追加します。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddHttpClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddHttpClient (this Microsoft.Extensions.DependencyInjection.IServiceCollection services);
static member AddHttpClient : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddHttpClient (services As IServiceCollection) As IServiceCollection

パラメーター

戻り値

IServiceCollection.

適用対象

AddHttpClient(IServiceCollection, String)

ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs

IHttpClientFactory および関連サービスを IServiceCollection に追加し、名前付き HttpClientを構成します。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddHttpClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, System::String ^ name);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddHttpClient (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string name);
static member AddHttpClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * string -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder
<Extension()>
Public Function AddHttpClient (services As IServiceCollection, name As String) As IHttpClientBuilder

パラメーター

name
String

構成する HttpClient の論理名。

戻り値

クライアントの構成に使用できる IHttpClientBuilder

注釈

指定 HttpClient 構成を適用するインスタンスは、CreateClient(String) と一致する名前を指定して取得できます。

DefaultName を名前として使用して、既定のクライアントを構成します。

適用対象

AddHttpClient(IServiceCollection, String, Action<IServiceProvider,HttpClient>)

ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs

IHttpClientFactory および関連サービスを IServiceCollection に追加し、名前付き HttpClientを構成します。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddHttpClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, System::String ^ name, Action<IServiceProvider ^, System::Net::Http::HttpClient ^> ^ configureClient);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddHttpClient (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string name, Action<IServiceProvider,System.Net.Http.HttpClient> configureClient);
static member AddHttpClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * Action<IServiceProvider, System.Net.Http.HttpClient> -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder
<Extension()>
Public Function AddHttpClient (services As IServiceCollection, name As String, configureClient As Action(Of IServiceProvider, HttpClient)) As IHttpClientBuilder

パラメーター

name
String

構成する HttpClient の論理名。

configureClient
Action<IServiceProvider,HttpClient>

HttpClientの構成に使用されるデリゲート。

戻り値

クライアントの構成に使用できる IHttpClientBuilder

注釈

指定 HttpClient 構成を適用するインスタンスは、CreateClient(String) と一致する名前を指定して取得できます。

DefaultName を名前として使用して、既定のクライアントを構成します。

適用対象

AddHttpClient(IServiceCollection, String, Action<HttpClient>)

ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs

IHttpClientFactory および関連サービスを IServiceCollection に追加し、名前付き HttpClientを構成します。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddHttpClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, System::String ^ name, Action<System::Net::Http::HttpClient ^> ^ configureClient);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddHttpClient (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string name, Action<System.Net.Http.HttpClient> configureClient);
static member AddHttpClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * Action<System.Net.Http.HttpClient> -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder
<Extension()>
Public Function AddHttpClient (services As IServiceCollection, name As String, configureClient As Action(Of HttpClient)) As IHttpClientBuilder

パラメーター

name
String

構成する HttpClient の論理名。

configureClient
Action<HttpClient>

HttpClientの構成に使用されるデリゲート。

戻り値

クライアントの構成に使用できる IHttpClientBuilder

注釈

指定 HttpClient 構成を適用するインスタンスは、CreateClient(String) と一致する名前を指定して取得できます。

DefaultName を名前として使用して、既定のクライアントを構成します。

適用対象

AddHttpClient<TClient,TImplementation>(IServiceCollection, String, Func<HttpClient,IServiceProvider,TImplementation>)

ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs

IHttpClientFactory および関連サービスを IServiceCollection に追加し、TClient 型と名前付き HttpClientの間のバインディングを構成します。

public:
generic <typename TClient, typename TImplementation>
 where TClient : class where TImplementation : class, TClient[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddHttpClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, System::String ^ name, Func<System::Net::Http::HttpClient ^, IServiceProvider ^, TImplementation> ^ factory);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddHttpClient<TClient,TImplementation> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string name, Func<System.Net.Http.HttpClient,IServiceProvider,TImplementation> factory) where TClient : class where TImplementation : class, TClient;
static member AddHttpClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * Func<System.Net.Http.HttpClient, IServiceProvider, #'Client> -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder (requires 'Client : null)
<Extension()>
Public Function AddHttpClient(Of TClient As Class, TImplementation As Class) (services As IServiceCollection, name As String, factory As Func(Of HttpClient, IServiceProvider, TImplementation)) As IHttpClientBuilder

型パラメーター

TClient

型指定されたクライアントの型。 指定された型は、一時的なサービスとしてサービス コレクションに登録されます。 型指定されたクライアントの作成の詳細については、ITypedHttpClientFactory<TClient> を参照してください。

TImplementation

型指定されたクライアントの実装型。

パラメーター

name
String

構成する HttpClient の論理名。

factory
Func<HttpClient,IServiceProvider,TImplementation>

TClientのインスタンスを作成するために使用されるデリゲート。

戻り値

クライアントの構成に使用できる IHttpClientBuilder

注釈

指定 HttpClient 構成を適用するインスタンスは、CreateClient(String) と一致する名前を指定して取得できます。

適切な HttpClient で構築された TClient インスタンスは、サービスの種類として TClient を指定することで、GetService(Type) (および関連するメソッド) から取得できます。

適用対象

AddHttpClient<TClient,TImplementation>(IServiceCollection, String, Action<HttpClient>)

ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs

IHttpClientFactory および関連サービスを IServiceCollection に追加し、TClient 型と名前付き HttpClientの間のバインディングを構成します。

public:
generic <typename TClient, typename TImplementation>
 where TClient : class where TImplementation : class, TClient[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddHttpClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, System::String ^ name, Action<System::Net::Http::HttpClient ^> ^ configureClient);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddHttpClient<TClient,TImplementation> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string name, Action<System.Net.Http.HttpClient> configureClient) where TClient : class where TImplementation : class, TClient;
static member AddHttpClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * Action<System.Net.Http.HttpClient> -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder (requires 'Client : null)
<Extension()>
Public Function AddHttpClient(Of TClient As Class, TImplementation As Class) (services As IServiceCollection, name As String, configureClient As Action(Of HttpClient)) As IHttpClientBuilder

型パラメーター

TClient

型指定されたクライアントの型。 指定された型は、一時的なサービスとしてサービス コレクションに登録されます。 型指定されたクライアントの作成の詳細については、ITypedHttpClientFactory<TClient> を参照してください。

TImplementation

型指定されたクライアントの実装型。 指定された型は、ITypedHttpClientFactory<TClient>によってインスタンス化されます。

パラメーター

name
String

構成する HttpClient の論理名。

configureClient
Action<HttpClient>

HttpClientの構成に使用されるデリゲート。

戻り値

クライアントの構成に使用できる IHttpClientBuilder

注釈

指定 HttpClient 構成を適用するインスタンスは、CreateClient(String) と一致する名前を指定して取得できます。

適切な HttpClient で構築された TClient インスタンスは、サービスの種類として TClient を指定することで、GetService(Type) (および関連するメソッド) から取得できます。

DefaultName を名前として使用して、既定のクライアントを構成します。

適用対象

AddHttpClient<TClient,TImplementation>(IServiceCollection, String, Action<IServiceProvider,HttpClient>)

ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs

IHttpClientFactory および関連サービスを IServiceCollection に追加し、TClient 型と名前付き HttpClientの間のバインディングを構成します。

public:
generic <typename TClient, typename TImplementation>
 where TClient : class where TImplementation : class, TClient[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddHttpClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, System::String ^ name, Action<IServiceProvider ^, System::Net::Http::HttpClient ^> ^ configureClient);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddHttpClient<TClient,TImplementation> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string name, Action<IServiceProvider,System.Net.Http.HttpClient> configureClient) where TClient : class where TImplementation : class, TClient;
static member AddHttpClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * Action<IServiceProvider, System.Net.Http.HttpClient> -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder (requires 'Client : null)
<Extension()>
Public Function AddHttpClient(Of TClient As Class, TImplementation As Class) (services As IServiceCollection, name As String, configureClient As Action(Of IServiceProvider, HttpClient)) As IHttpClientBuilder

型パラメーター

TClient

型指定されたクライアントの型。 指定された型は、一時的なサービスとしてサービス コレクションに登録されます。 型指定されたクライアントの作成の詳細については、ITypedHttpClientFactory<TClient> を参照してください。

TImplementation

型指定されたクライアントの実装型。 指定された型は、ITypedHttpClientFactory<TClient>によってインスタンス化されます。

パラメーター

name
String

構成する HttpClient の論理名。

configureClient
Action<IServiceProvider,HttpClient>

HttpClientの構成に使用されるデリゲート。

戻り値

クライアントの構成に使用できる IHttpClientBuilder

注釈

指定 HttpClient 構成を適用するインスタンスは、CreateClient(String) と一致する名前を指定して取得できます。

適切な HttpClient で構築された TClient インスタンスは、サービスの種類として TClient を指定することで、GetService(Type) (および関連するメソッド) から取得できます。

DefaultName を名前として使用して、既定のクライアントを構成します。

適用対象

AddHttpClient<TClient,TImplementation>(IServiceCollection, String)

ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs

IHttpClientFactory および関連サービスを IServiceCollection に追加し、TClient 型と名前付き HttpClientの間のバインディングを構成します。 クライアント名は、TClientの型名に設定されます。

public:
generic <typename TClient, typename TImplementation>
 where TClient : class where TImplementation : class, TClient[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddHttpClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, System::String ^ name);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddHttpClient<TClient,TImplementation> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string name) where TClient : class where TImplementation : class, TClient;
static member AddHttpClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * string -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder (requires 'Client : null)
<Extension()>
Public Function AddHttpClient(Of TClient As Class, TImplementation As Class) (services As IServiceCollection, name As String) As IHttpClientBuilder

型パラメーター

TClient

型指定されたクライアントの型。 指定された型は、一時的なサービスとしてサービス コレクションに登録されます。 型指定されたクライアントの作成の詳細については、ITypedHttpClientFactory<TClient> を参照してください。

TImplementation

型指定されたクライアントの実装型。 指定された型は、ITypedHttpClientFactory<TClient>によってインスタンス化されます。

パラメーター

name
String

構成する HttpClient の論理名。

戻り値

クライアントの構成に使用できる IHttpClientBuilder

注釈

指定 HttpClient 構成を適用するインスタンスは、CreateClient(String) と一致する名前を指定して取得できます。

適切な HttpClient で構築された TClient インスタンスは、サービスの種類として TClient を指定することで、GetService(Type) (および関連するメソッド) から取得できます。

DefaultName を名前として使用して、既定のクライアントを構成します。

適用対象

AddHttpClient<TClient,TImplementation>(IServiceCollection, Func<HttpClient,TImplementation>)

ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs

IHttpClientFactory および関連サービスを IServiceCollection に追加し、TClient 型と名前付き HttpClientの間のバインディングを構成します。

public:
generic <typename TClient, typename TImplementation>
 where TClient : class where TImplementation : class, TClient[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddHttpClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Func<System::Net::Http::HttpClient ^, TImplementation> ^ factory);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddHttpClient<TClient,TImplementation> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Func<System.Net.Http.HttpClient,TImplementation> factory) where TClient : class where TImplementation : class, TClient;
static member AddHttpClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * Func<System.Net.Http.HttpClient, #'Client> -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder (requires 'Client : null)
<Extension()>
Public Function AddHttpClient(Of TClient As Class, TImplementation As Class) (services As IServiceCollection, factory As Func(Of HttpClient, TImplementation)) As IHttpClientBuilder

型パラメーター

TClient

型指定されたクライアントの型。 指定された型は、一時的なサービスとしてサービス コレクションに登録されます。 型指定されたクライアントの作成の詳細については、ITypedHttpClientFactory<TClient> を参照してください。

TImplementation

型指定されたクライアントの実装型。

パラメーター

factory
Func<HttpClient,TImplementation>

TClientのインスタンスを作成するために使用されるデリゲート。

戻り値

クライアントの構成に使用できる IHttpClientBuilder

注釈

指定 HttpClient 構成を適用するインスタンスは、CreateClient(String) と一致する名前を指定して取得できます。

適切な HttpClient で構築された TClient インスタンスは、サービスの種類として TClient を指定することで、GetService(Type) (および関連するメソッド) から取得できます。

適用対象

AddHttpClient<TClient,TImplementation>(IServiceCollection, Func<HttpClient,IServiceProvider,TImplementation>)

ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs

IHttpClientFactory および関連サービスを IServiceCollection に追加し、TClient 型と名前付き HttpClientの間のバインディングを構成します。

public:
generic <typename TClient, typename TImplementation>
 where TClient : class where TImplementation : class, TClient[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddHttpClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Func<System::Net::Http::HttpClient ^, IServiceProvider ^, TImplementation> ^ factory);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddHttpClient<TClient,TImplementation> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Func<System.Net.Http.HttpClient,IServiceProvider,TImplementation> factory) where TClient : class where TImplementation : class, TClient;
static member AddHttpClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * Func<System.Net.Http.HttpClient, IServiceProvider, #'Client> -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder (requires 'Client : null)
<Extension()>
Public Function AddHttpClient(Of TClient As Class, TImplementation As Class) (services As IServiceCollection, factory As Func(Of HttpClient, IServiceProvider, TImplementation)) As IHttpClientBuilder

型パラメーター

TClient

型指定されたクライアントの型。 指定された型は、一時的なサービスとしてサービス コレクションに登録されます。 型指定されたクライアントの作成の詳細については、ITypedHttpClientFactory<TClient> を参照してください。

TImplementation

型指定されたクライアントの実装型。

パラメーター

factory
Func<HttpClient,IServiceProvider,TImplementation>

TClientのインスタンスを作成するために使用されるデリゲート。

戻り値

クライアントの構成に使用できる IHttpClientBuilder

注釈

指定 HttpClient 構成を適用するインスタンスは、CreateClient(String) と一致する名前を指定して取得できます。

適切な HttpClient で構築された TClient インスタンスは、サービスの種類として TClient を指定することで、GetService(Type) (および関連するメソッド) から取得できます。

適用対象

AddHttpClient<TClient,TImplementation>(IServiceCollection, Action<HttpClient>)

ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs

IHttpClientFactory および関連サービスを IServiceCollection に追加し、TClient 型と名前付き HttpClientの間のバインディングを構成します。 クライアント名は、TClientの型名に設定されます。

public:
generic <typename TClient, typename TImplementation>
 where TClient : class where TImplementation : class, TClient[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddHttpClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Action<System::Net::Http::HttpClient ^> ^ configureClient);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddHttpClient<TClient,TImplementation> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<System.Net.Http.HttpClient> configureClient) where TClient : class where TImplementation : class, TClient;
static member AddHttpClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<System.Net.Http.HttpClient> -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder (requires 'Client : null)
<Extension()>
Public Function AddHttpClient(Of TClient As Class, TImplementation As Class) (services As IServiceCollection, configureClient As Action(Of HttpClient)) As IHttpClientBuilder

型パラメーター

TClient

型指定されたクライアントの型。 指定された型は、一時的なサービスとしてサービス コレクションに登録されます。 型指定されたクライアントの作成の詳細については、ITypedHttpClientFactory<TClient> を参照してください。

TImplementation

型指定されたクライアントの実装型。 指定された型は、ITypedHttpClientFactory<TClient>によってインスタンス化されます。

パラメーター

configureClient
Action<HttpClient>

HttpClientの構成に使用されるデリゲート。

戻り値

クライアントの構成に使用できる IHttpClientBuilder

注釈

指定 HttpClient 構成を適用するインスタンスは、CreateClient(String) と一致する名前を指定して取得できます。

適切な HttpClient で構築された TClient インスタンスは、サービスの種類として TClient を指定することで、GetService(Type) (および関連するメソッド) から取得できます。

適用対象

AddHttpClient<TClient,TImplementation>(IServiceCollection)

ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs

IHttpClientFactory および関連サービスを IServiceCollection に追加し、TClient 型と名前付き HttpClientの間のバインディングを構成します。 クライアント名は、TClientの型名に設定されます。

public:
generic <typename TClient, typename TImplementation>
 where TClient : class where TImplementation : class, TClient[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddHttpClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddHttpClient<TClient,TImplementation> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services) where TClient : class where TImplementation : class, TClient;
static member AddHttpClient : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder (requires 'Client : null)
<Extension()>
Public Function AddHttpClient(Of TClient As Class, TImplementation As Class) (services As IServiceCollection) As IHttpClientBuilder

型パラメーター

TClient

型指定されたクライアントの型。 指定された型は、一時的なサービスとしてサービス コレクションに登録されます。 型指定されたクライアントの作成の詳細については、ITypedHttpClientFactory<TClient> を参照してください。

TImplementation

型指定されたクライアントの実装型。 指定された型は、ITypedHttpClientFactory<TClient>によってインスタンス化されます。

パラメーター

戻り値

クライアントの構成に使用できる IHttpClientBuilder

注釈

指定 HttpClient 構成を適用するインスタンスは、CreateClient(String) と一致する名前を指定して取得できます。

適切な HttpClient で構築された TClient インスタンスは、サービスの種類として TClient を指定することで、GetService(Type) (および関連するメソッド) から取得できます。

適用対象

AddHttpClient<TClient,TImplementation>(IServiceCollection, String, Func<HttpClient,TImplementation>)

ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs

IHttpClientFactory および関連サービスを IServiceCollection に追加し、TClient 型と名前付き HttpClientの間のバインディングを構成します。

public:
generic <typename TClient, typename TImplementation>
 where TClient : class where TImplementation : class, TClient[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddHttpClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, System::String ^ name, Func<System::Net::Http::HttpClient ^, TImplementation> ^ factory);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddHttpClient<TClient,TImplementation> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string name, Func<System.Net.Http.HttpClient,TImplementation> factory) where TClient : class where TImplementation : class, TClient;
static member AddHttpClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * Func<System.Net.Http.HttpClient, #'Client> -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder (requires 'Client : null)
<Extension()>
Public Function AddHttpClient(Of TClient As Class, TImplementation As Class) (services As IServiceCollection, name As String, factory As Func(Of HttpClient, TImplementation)) As IHttpClientBuilder

型パラメーター

TClient

型指定されたクライアントの型。 指定された型は、一時的なサービスとしてサービス コレクションに登録されます。 型指定されたクライアントの作成の詳細については、ITypedHttpClientFactory<TClient> を参照してください。

TImplementation

型指定されたクライアントの実装型。

パラメーター

name
String

構成する HttpClient の論理名。

factory
Func<HttpClient,TImplementation>

TClientのインスタンスを作成するために使用されるデリゲート。

戻り値

クライアントの構成に使用できる IHttpClientBuilder

注釈

指定 HttpClient 構成を適用するインスタンスは、CreateClient(String) と一致する名前を指定して取得できます。

適切な HttpClient で構築された TClient インスタンスは、サービスの種類として TClient を指定することで、GetService(Type) (および関連するメソッド) から取得できます。

適用対象

AddHttpClient<TClient,TImplementation>(IServiceCollection, Action<IServiceProvider,HttpClient>)

ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs

IHttpClientFactory および関連サービスを IServiceCollection に追加し、TClient 型と名前付き HttpClientの間のバインディングを構成します。 クライアント名は、TClientの型名に設定されます。

public:
generic <typename TClient, typename TImplementation>
 where TClient : class where TImplementation : class, TClient[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddHttpClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Action<IServiceProvider ^, System::Net::Http::HttpClient ^> ^ configureClient);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddHttpClient<TClient,TImplementation> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<IServiceProvider,System.Net.Http.HttpClient> configureClient) where TClient : class where TImplementation : class, TClient;
static member AddHttpClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<IServiceProvider, System.Net.Http.HttpClient> -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder (requires 'Client : null)
<Extension()>
Public Function AddHttpClient(Of TClient As Class, TImplementation As Class) (services As IServiceCollection, configureClient As Action(Of IServiceProvider, HttpClient)) As IHttpClientBuilder

型パラメーター

TClient

型指定されたクライアントの型。 指定された型は、一時的なサービスとしてサービス コレクションに登録されます。 型指定されたクライアントの作成の詳細については、ITypedHttpClientFactory<TClient> を参照してください。

TImplementation

型指定されたクライアントの実装型。 指定された型は、ITypedHttpClientFactory<TClient>によってインスタンス化されます。

パラメーター

configureClient
Action<IServiceProvider,HttpClient>

HttpClientの構成に使用されるデリゲート。

戻り値

クライアントの構成に使用できる IHttpClientBuilder

注釈

指定 HttpClient 構成を適用するインスタンスは、CreateClient(String) と一致する名前を指定して取得できます。

適切な HttpClient で構築された TClient インスタンスは、サービスの種類として TClient を指定することで、GetService(Type) (および関連するメソッド) から取得できます。

適用対象

AddHttpClient<TClient>(IServiceCollection, String, Action<HttpClient>)

ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs

IHttpClientFactory および関連サービスを IServiceCollection に追加し、TClient 型と名前付き HttpClientの間のバインディングを構成します。

public:
generic <typename TClient>
 where TClient : class[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddHttpClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, System::String ^ name, Action<System::Net::Http::HttpClient ^> ^ configureClient);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddHttpClient<TClient> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string name, Action<System.Net.Http.HttpClient> configureClient) where TClient : class;
static member AddHttpClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * Action<System.Net.Http.HttpClient> -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder (requires 'Client : null)
<Extension()>
Public Function AddHttpClient(Of TClient As Class) (services As IServiceCollection, name As String, configureClient As Action(Of HttpClient)) As IHttpClientBuilder

型パラメーター

TClient

型指定されたクライアントの型。 指定された型は、一時的なサービスとしてサービス コレクションに登録されます。 型指定されたクライアントの作成の詳細については、ITypedHttpClientFactory<TClient> を参照してください。

パラメーター

name
String

構成する HttpClient の論理名。

configureClient
Action<HttpClient>

HttpClientの構成に使用されるデリゲート。

戻り値

クライアントの構成に使用できる IHttpClientBuilder

注釈

指定 HttpClient 構成を適用するインスタンスは、CreateClient(String) と一致する名前を指定して取得できます。

適切な HttpClient で構築された TClient インスタンスは、サービスの種類として TClient を指定することで、GetService(Type) (および関連するメソッド) から取得できます。

DefaultName を名前として使用して、既定のクライアントを構成します。

適用対象

AddHttpClient<TClient>(IServiceCollection, String, Action<IServiceProvider,HttpClient>)

ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs

IHttpClientFactory および関連サービスを IServiceCollection に追加し、TClient 型と名前付き HttpClientの間のバインディングを構成します。

public:
generic <typename TClient>
 where TClient : class[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddHttpClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, System::String ^ name, Action<IServiceProvider ^, System::Net::Http::HttpClient ^> ^ configureClient);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddHttpClient<TClient> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string name, Action<IServiceProvider,System.Net.Http.HttpClient> configureClient) where TClient : class;
static member AddHttpClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * Action<IServiceProvider, System.Net.Http.HttpClient> -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder (requires 'Client : null)
<Extension()>
Public Function AddHttpClient(Of TClient As Class) (services As IServiceCollection, name As String, configureClient As Action(Of IServiceProvider, HttpClient)) As IHttpClientBuilder

型パラメーター

TClient

型指定されたクライアントの型。 指定された型は、一時的なサービスとしてサービス コレクションに登録されます。 型指定されたクライアントの作成の詳細については、ITypedHttpClientFactory<TClient> を参照してください。

パラメーター

name
String

構成する HttpClient の論理名。

configureClient
Action<IServiceProvider,HttpClient>

HttpClientの構成に使用されるデリゲート。

戻り値

クライアントの構成に使用できる IHttpClientBuilder

注釈

指定 HttpClient 構成を適用するインスタンスは、CreateClient(String) と一致する名前を指定して取得できます。

適切な HttpClient で構築された TClient インスタンスは、サービスの種類として TClient を指定することで、GetService(Type) (および関連するメソッド) から取得できます。

DefaultName を名前として使用して、既定のクライアントを構成します。

適用対象

AddHttpClient<TClient>(IServiceCollection, String)

ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs

IHttpClientFactory および関連サービスを IServiceCollection に追加し、TClient 型と名前付き HttpClientの間のバインディングを構成します。

public:
generic <typename TClient>
 where TClient : class[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddHttpClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, System::String ^ name);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddHttpClient<TClient> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string name) where TClient : class;
static member AddHttpClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * string -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder (requires 'Client : null)
<Extension()>
Public Function AddHttpClient(Of TClient As Class) (services As IServiceCollection, name As String) As IHttpClientBuilder

型パラメーター

TClient

型指定されたクライアントの型。 指定された型は、一時的なサービスとしてサービス コレクションに登録されます。 型指定されたクライアントの作成の詳細については、ITypedHttpClientFactory<TClient> を参照してください。

パラメーター

name
String

構成する HttpClient の論理名。

戻り値

クライアントの構成に使用できる IHttpClientBuilder

注釈

指定 HttpClient 構成を適用するインスタンスは、CreateClient(String) と一致する名前を指定して取得できます。

適切な HttpClient で構築された TClient インスタンスは、サービスの種類として TClient を指定することで、GetService(Type) (および関連するメソッド) から取得できます。

DefaultName を名前として使用して、既定のクライアントを構成します。

適用対象

AddHttpClient<TClient>(IServiceCollection, Action<HttpClient>)

ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs

IHttpClientFactory および関連サービスを IServiceCollection に追加し、TClient 型と名前付き HttpClientの間のバインディングを構成します。 クライアント名は、TClientの型名に設定されます。

public:
generic <typename TClient>
 where TClient : class[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddHttpClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Action<System::Net::Http::HttpClient ^> ^ configureClient);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddHttpClient<TClient> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<System.Net.Http.HttpClient> configureClient) where TClient : class;
static member AddHttpClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<System.Net.Http.HttpClient> -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder (requires 'Client : null)
<Extension()>
Public Function AddHttpClient(Of TClient As Class) (services As IServiceCollection, configureClient As Action(Of HttpClient)) As IHttpClientBuilder

型パラメーター

TClient

型指定されたクライアントの型。 指定された型は、一時的なサービスとしてサービス コレクションに登録されます。 型指定されたクライアントの作成の詳細については、ITypedHttpClientFactory<TClient> を参照してください。

パラメーター

configureClient
Action<HttpClient>

HttpClientの構成に使用されるデリゲート。

戻り値

クライアントの構成に使用できる IHttpClientBuilder

注釈

指定 HttpClient 構成を適用するインスタンスは、CreateClient(String) と一致する名前を指定して取得できます。

適切な HttpClient で構築された TClient インスタンスは、サービスの種類として TClient を指定することで、GetService(Type) (および関連するメソッド) から取得できます。

適用対象

AddHttpClient<TClient>(IServiceCollection, Action<IServiceProvider,HttpClient>)

ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs

IHttpClientFactory および関連サービスを IServiceCollection に追加し、TClient 型と名前付き HttpClientの間のバインディングを構成します。 クライアント名は、TClientの型名に設定されます。

public:
generic <typename TClient>
 where TClient : class[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddHttpClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Action<IServiceProvider ^, System::Net::Http::HttpClient ^> ^ configureClient);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddHttpClient<TClient> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<IServiceProvider,System.Net.Http.HttpClient> configureClient) where TClient : class;
static member AddHttpClient : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<IServiceProvider, System.Net.Http.HttpClient> -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder (requires 'Client : null)
<Extension()>
Public Function AddHttpClient(Of TClient As Class) (services As IServiceCollection, configureClient As Action(Of IServiceProvider, HttpClient)) As IHttpClientBuilder

型パラメーター

TClient

型指定されたクライアントの型。 指定された型は、一時的なサービスとしてサービス コレクションに登録されます。 型指定されたクライアントの作成の詳細については、ITypedHttpClientFactory<TClient> を参照してください。

パラメーター

configureClient
Action<IServiceProvider,HttpClient>

HttpClientの構成に使用されるデリゲート。

戻り値

クライアントの構成に使用できる IHttpClientBuilder

注釈

指定 HttpClient 構成を適用するインスタンスは、CreateClient(String) と一致する名前を指定して取得できます。

適切な HttpClient で構築された TClient インスタンスは、サービスの種類として TClient を指定することで、GetService(Type) (および関連するメソッド) から取得できます。

適用対象

AddHttpClient<TClient>(IServiceCollection)

ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs
ソース:
HttpClientFactoryServiceCollectionExtensions.cs

IHttpClientFactory および関連サービスを IServiceCollection に追加し、TClient 型と名前付き HttpClientの間のバインディングを構成します。 クライアント名は、TClientの完全な名前に設定されます。

public:
generic <typename TClient>
 where TClient : class[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddHttpClient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddHttpClient<TClient> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services) where TClient : class;
static member AddHttpClient : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder (requires 'Client : null)
<Extension()>
Public Function AddHttpClient(Of TClient As Class) (services As IServiceCollection) As IHttpClientBuilder

型パラメーター

TClient

型指定されたクライアントの型。 指定された型は、一時的なサービスとしてサービス コレクションに登録されます。 型指定されたクライアントの作成の詳細については、ITypedHttpClientFactory<TClient> を参照してください。

パラメーター

戻り値

クライアントの構成に使用できる IHttpClientBuilder

注釈

指定 HttpClient 構成を適用するインスタンスは、CreateClient(String) と一致する名前を指定して取得できます。

適切な HttpClient で構築された TClient インスタンスは、サービスの種類として TClient を指定することで、GetService(Type) (および関連するメソッド) から取得できます。

適用対象