HttpClientFactoryServiceCollectionExtensions.AddHttpClient メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
オーバーロード
AddHttpClient(IServiceCollection)
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
パラメーター
- services
- IServiceCollection
戻り値
適用対象
AddHttpClient(IServiceCollection, String)
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
パラメーター
- services
- IServiceCollection
- name
- String
構成する HttpClient の論理名。
戻り値
クライアントを構成するために使用できる IHttpClientBuilder。
注釈
HttpClient指定された構成を適用するインスタンスは、を使用して取得 CreateClient(String) し、一致する名前を指定できます。
既定のクライアントを構成するには、名前として を使用 DefaultName します。
適用対象
AddHttpClient(IServiceCollection, String, Action<IServiceProvider,HttpClient>)
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
パラメーター
- services
- IServiceCollection
- name
- String
構成する HttpClient の論理名。
- configureClient
- Action<IServiceProvider,HttpClient>
HttpClient の構成に使用されるデリゲート。
戻り値
クライアントを構成するために使用できる IHttpClientBuilder。
注釈
HttpClient指定された構成を適用するインスタンスは、を使用して取得 CreateClient(String) し、一致する名前を指定できます。
既定のクライアントを構成するには、名前として を使用 DefaultName します。
適用対象
AddHttpClient(IServiceCollection, String, Action<HttpClient>)
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
パラメーター
- services
- IServiceCollection
- name
- String
構成する HttpClient の論理名。
- configureClient
- Action<HttpClient>
HttpClient の構成に使用されるデリゲート。
戻り値
クライアントを構成するために使用できる IHttpClientBuilder。
注釈
HttpClient指定された構成を適用するインスタンスは、を使用して取得 CreateClient(String) し、一致する名前を指定できます。
既定のクライアントを構成するには、名前として を使用 DefaultName します。
適用対象
AddHttpClient<TClient,TImplementation>(IServiceCollection, String, Func<HttpClient,IServiceProvider,TImplementation>)
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
型指定されたクライアントの実装型。
パラメーター
- services
- IServiceCollection
- name
- String
構成する HttpClient の論理名。
- factory
- Func<HttpClient,IServiceProvider,TImplementation>
TClient
のインスタンスの作成に使用されるデリゲート。
戻り値
クライアントを構成するために使用できる IHttpClientBuilder。
注釈
HttpClient指定された構成を適用するインスタンスは、を使用して取得 CreateClient(String) し、一致する名前を指定できます。
TClient
適切なを使用して構築されたインスタンスは、 HttpClientGetService(Type) サービスの種類としてを指定することによって、(および関連するメソッド) から取得でき TClient
ます。
適用対象
AddHttpClient<TClient,TImplementation>(IServiceCollection, String, Action<HttpClient>)
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>インスタンス化されます。
パラメーター
- services
- IServiceCollection
- name
- String
構成する HttpClient の論理名。
- configureClient
- Action<HttpClient>
HttpClient の構成に使用されるデリゲート。
戻り値
クライアントを構成するために使用できる IHttpClientBuilder。
注釈
HttpClient指定された構成を適用するインスタンスは、を使用して取得 CreateClient(String) し、一致する名前を指定できます。
TClient
適切なを使用して構築されたインスタンスは、 HttpClientGetService(Type) サービスの種類としてを指定することによって、(および関連するメソッド) から取得でき TClient
ます。
既定のクライアントを構成するには、名前として を使用 DefaultName します。
適用対象
AddHttpClient<TClient,TImplementation>(IServiceCollection, String, Action<IServiceProvider,HttpClient>)
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>インスタンス化されます。
パラメーター
- services
- IServiceCollection
- name
- String
構成する HttpClient の論理名。
- configureClient
- Action<IServiceProvider,HttpClient>
HttpClient の構成に使用されるデリゲート。
戻り値
クライアントを構成するために使用できる IHttpClientBuilder。
注釈
HttpClient指定された構成を適用するインスタンスは、を使用して取得 CreateClient(String) し、一致する名前を指定できます。
TClient
適切なを使用して構築されたインスタンスは、 HttpClientGetService(Type) サービスの種類としてを指定することによって、(および関連するメソッド) から取得でき TClient
ます。
既定のクライアントを構成するには、名前として を使用 DefaultName します。
適用対象
AddHttpClient<TClient,TImplementation>(IServiceCollection, String)
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>インスタンス化されます。
パラメーター
- services
- IServiceCollection
- name
- String
構成する HttpClient の論理名。
戻り値
クライアントを構成するために使用できる IHttpClientBuilder。
注釈
HttpClient指定された構成を適用するインスタンスは、を使用して取得 CreateClient(String) し、一致する名前を指定できます。
TClient
適切なを使用して構築されたインスタンスは、 HttpClientGetService(Type) サービスの種類としてを指定することによって、(および関連するメソッド) から取得でき TClient
ます。
既定のクライアントを構成するには、名前として を使用 DefaultName します。
適用対象
AddHttpClient<TClient,TImplementation>(IServiceCollection, Func<HttpClient,TImplementation>)
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
型指定されたクライアントの実装型。
パラメーター
- services
- IServiceCollection
- factory
- Func<HttpClient,TImplementation>
TClient
のインスタンスの作成に使用されるデリゲート。
戻り値
クライアントを構成するために使用できる IHttpClientBuilder。
注釈
HttpClient指定された構成を適用するインスタンスは、を使用して取得 CreateClient(String) し、一致する名前を指定できます。
TClient
適切なを使用して構築されたインスタンスは、 HttpClientGetService(Type) サービスの種類としてを指定することによって、(および関連するメソッド) から取得でき TClient
ます。
適用対象
AddHttpClient<TClient,TImplementation>(IServiceCollection, Func<HttpClient,IServiceProvider,TImplementation>)
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
型指定されたクライアントの実装型。
パラメーター
- services
- IServiceCollection
- factory
- Func<HttpClient,IServiceProvider,TImplementation>
TClient
のインスタンスの作成に使用されるデリゲート。
戻り値
クライアントを構成するために使用できる IHttpClientBuilder。
注釈
HttpClient指定された構成を適用するインスタンスは、を使用して取得 CreateClient(String) し、一致する名前を指定できます。
TClient
適切なを使用して構築されたインスタンスは、 HttpClientGetService(Type) サービスの種類としてを指定することによって、(および関連するメソッド) から取得でき TClient
ます。
適用対象
AddHttpClient<TClient,TImplementation>(IServiceCollection, Action<HttpClient>)
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>インスタンス化されます。
パラメーター
- services
- IServiceCollection
- configureClient
- Action<HttpClient>
HttpClient の構成に使用されるデリゲート。
戻り値
クライアントを構成するために使用できる IHttpClientBuilder。
注釈
HttpClient指定された構成を適用するインスタンスは、を使用して取得 CreateClient(String) し、一致する名前を指定できます。
TClient
適切なを使用して構築されたインスタンスは、 HttpClientGetService(Type) サービスの種類としてを指定することによって、(および関連するメソッド) から取得でき TClient
ます。
適用対象
AddHttpClient<TClient,TImplementation>(IServiceCollection)
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>インスタンス化されます。
パラメーター
- services
- IServiceCollection
戻り値
クライアントを構成するために使用できる IHttpClientBuilder。
注釈
HttpClient指定された構成を適用するインスタンスは、を使用して取得 CreateClient(String) し、一致する名前を指定できます。
TClient
適切なを使用して構築されたインスタンスは、 HttpClientGetService(Type) サービスの種類としてを指定することによって、(および関連するメソッド) から取得でき TClient
ます。
適用対象
AddHttpClient<TClient,TImplementation>(IServiceCollection, String, Func<HttpClient,TImplementation>)
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
型指定されたクライアントの実装型。
パラメーター
- services
- IServiceCollection
- name
- String
構成する HttpClient の論理名。
- factory
- Func<HttpClient,TImplementation>
TClient
のインスタンスの作成に使用されるデリゲート。
戻り値
クライアントを構成するために使用できる IHttpClientBuilder。
注釈
HttpClient指定された構成を適用するインスタンスは、を使用して取得 CreateClient(String) し、一致する名前を指定できます。
TClient
適切なを使用して構築されたインスタンスは、 HttpClientGetService(Type) サービスの種類としてを指定することによって、(および関連するメソッド) から取得でき TClient
ます。
適用対象
AddHttpClient<TClient,TImplementation>(IServiceCollection, Action<IServiceProvider,HttpClient>)
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>インスタンス化されます。
パラメーター
- services
- IServiceCollection
- configureClient
- Action<IServiceProvider,HttpClient>
HttpClient の構成に使用されるデリゲート。
戻り値
クライアントを構成するために使用できる IHttpClientBuilder。
注釈
HttpClient指定された構成を適用するインスタンスは、を使用して取得 CreateClient(String) し、一致する名前を指定できます。
TClient
適切なを使用して構築されたインスタンスは、 HttpClientGetService(Type) サービスの種類としてを指定することによって、(および関連するメソッド) から取得でき TClient
ます。
適用対象
AddHttpClient<TClient>(IServiceCollection, String, Action<HttpClient>)
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> してください。
パラメーター
- services
- IServiceCollection
- name
- String
構成する HttpClient の論理名。
- configureClient
- Action<HttpClient>
HttpClient の構成に使用されるデリゲート。
戻り値
クライアントを構成するために使用できる IHttpClientBuilder。
注釈
HttpClient指定された構成を適用するインスタンスは、を使用して取得 CreateClient(String) し、一致する名前を指定できます。
TClient
適切なを使用して構築されたインスタンスは、 HttpClientGetService(Type) サービスの種類としてを指定することによって、(および関連するメソッド) から取得でき TClient
ます。
既定のクライアントを構成するには、名前として を使用 DefaultName します。
適用対象
AddHttpClient<TClient>(IServiceCollection, String, Action<IServiceProvider,HttpClient>)
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> してください。
パラメーター
- services
- IServiceCollection
- name
- String
構成する HttpClient の論理名。
- configureClient
- Action<IServiceProvider,HttpClient>
HttpClient の構成に使用されるデリゲート。
戻り値
クライアントを構成するために使用できる IHttpClientBuilder。
注釈
HttpClient指定された構成を適用するインスタンスは、を使用して取得 CreateClient(String) し、一致する名前を指定できます。
TClient
適切なを使用して構築されたインスタンスは、 HttpClientGetService(Type) サービスの種類としてを指定することによって、(および関連するメソッド) から取得でき TClient
ます。
既定のクライアントを構成するには、名前として を使用 DefaultName します。
適用対象
AddHttpClient<TClient>(IServiceCollection, String)
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> してください。
パラメーター
- services
- IServiceCollection
- name
- String
構成する HttpClient の論理名。
戻り値
クライアントを構成するために使用できる IHttpClientBuilder。
注釈
HttpClient指定された構成を適用するインスタンスは、を使用して取得 CreateClient(String) し、一致する名前を指定できます。
TClient
適切なを使用して構築されたインスタンスは、 HttpClientGetService(Type) サービスの種類としてを指定することによって、(および関連するメソッド) から取得でき TClient
ます。
既定のクライアントを構成するには、名前として を使用 DefaultName します。
適用対象
AddHttpClient<TClient>(IServiceCollection, Action<HttpClient>)
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> してください。
パラメーター
- services
- IServiceCollection
- configureClient
- Action<HttpClient>
HttpClient の構成に使用されるデリゲート。
戻り値
クライアントを構成するために使用できる IHttpClientBuilder。
注釈
HttpClient指定された構成を適用するインスタンスは、を使用して取得 CreateClient(String) し、一致する名前を指定できます。
TClient
適切なを使用して構築されたインスタンスは、 HttpClientGetService(Type) サービスの種類としてを指定することによって、(および関連するメソッド) から取得でき TClient
ます。
適用対象
AddHttpClient<TClient>(IServiceCollection, Action<IServiceProvider,HttpClient>)
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> してください。
パラメーター
- services
- IServiceCollection
- configureClient
- Action<IServiceProvider,HttpClient>
HttpClient の構成に使用されるデリゲート。
戻り値
クライアントを構成するために使用できる IHttpClientBuilder。
注釈
HttpClient指定された構成を適用するインスタンスは、を使用して取得 CreateClient(String) し、一致する名前を指定できます。
TClient
適切なを使用して構築されたインスタンスは、 HttpClientGetService(Type) サービスの種類としてを指定することによって、(および関連するメソッド) から取得でき TClient
ます。
適用対象
AddHttpClient<TClient>(IServiceCollection)
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> してください。
パラメーター
- services
- IServiceCollection
戻り値
クライアントを構成するために使用できる IHttpClientBuilder。
注釈
HttpClient指定された構成を適用するインスタンスは、を使用して取得 CreateClient(String) し、一致する名前を指定できます。
TClient
適切なを使用して構築されたインスタンスは、 HttpClientGetService(Type) サービスの種類としてを指定することによって、(および関連するメソッド) から取得でき TClient
ます。
適用対象
.NET
フィードバック
https://aka.ms/ContentUserFeedback」を参照してください。
以下は間もなく提供いたします。2024 年を通じて、コンテンツのフィードバック メカニズムとして GitHub の issue を段階的に廃止し、新しいフィードバック システムに置き換えます。 詳細については、「フィードバックの送信と表示