IHttpClientBuilder インターフェイス

定義

IHttpClientFactory によって返される名前付き HttpClient インスタンスを構成するためのビルダー。

public interface class IHttpClientBuilder
public interface IHttpClientBuilder
type IHttpClientBuilder = interface
Public Interface IHttpClientBuilder

プロパティ

Name

このビルダーによって構成されるクライアントの名前を取得します。

Services

アプリケーション サービス コレクションを取得します。

拡張メソッド

AddDefaultLogger(IHttpClientBuilder)

を呼び出RemoveAllLoggers(IHttpClientBuilder)して以前に削除した場合は、 という名前HttpClientの既定のログ記録を戻します。

AddHttpMessageHandler(IHttpClientBuilder, Func<IServiceProvider,DelegatingHandler>)

名前付き HttpClient の追加メッセージ ハンドラーの作成に使用されるデリゲートを追加します。

AddHttpMessageHandler(IHttpClientBuilder, Func<DelegatingHandler>)

名前付き HttpClient の追加メッセージ ハンドラーの作成に使用されるデリゲートを追加します。

AddHttpMessageHandler<THandler>(IHttpClientBuilder)

名前付き HttpClient の依存関係挿入コンテナーからメッセージ ハンドラーを追加します。

AddLogger(IHttpClientBuilder, Func<IServiceProvider,IHttpClientLogger>, Boolean)

という名前 HttpClientの に対して追加のロガーを作成するために使用されるデリゲートを追加します。 カスタム ロガーは、対応する という名前 HttpClientの のすべての要求に対して、専用のログ DelegatingHandler から呼び出されます。

AddLogger<TLogger>(IHttpClientBuilder, Boolean)

という名前 HttpClientの に対して追加のロガーを作成するために使用されるデリゲートを追加します。 カスタム ロガーは、対応する という名前 HttpClientの のすべての要求に対して、専用のログ DelegatingHandler から呼び出されます。

AddTypedClient<TClient>(IHttpClientBuilder)

IHttpClientBuilder で関連付けられている TClient 型と名前付き HttpClient の間のバインドを構成します。

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

IHttpClientBuilder で関連付けられている TClient 型と名前付き HttpClient の間のバインドを構成します。

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

IHttpClientBuilder で関連付けられている TClient 型と名前付き HttpClient の間のバインドを構成します。

AddTypedClient<TClient,TImplementation>(IHttpClientBuilder)

IHttpClientBuilder で関連付けられている TClient 型と名前付き HttpClient の間のバインドを構成します。 作成されたインスタンスの型は TImplementation になります。

ConfigureAdditionalHttpMessageHandlers(IHttpClientBuilder, Action<IList<DelegatingHandler>,IServiceProvider>)

名前付き HttpClientに を使用して追加のメッセージ ハンドラーをHttpMessageHandlerBuilder構成するために使用するデリゲートを追加します。

ConfigureHttpClient(IHttpClientBuilder, Action<IServiceProvider,HttpClient>)

名前付き HttpClient の構成に使用されるデリゲートを追加します。

ConfigureHttpClient(IHttpClientBuilder, Action<HttpClient>)

名前付き HttpClient の構成に使用されるデリゲートを追加します。

ConfigureHttpMessageHandlerBuilder(IHttpClientBuilder, Action<HttpMessageHandlerBuilder>)
古い.

名前付き HttpClient に対して HttpMessageHandlerBuilder を使用し、メッセージ ハンドラーを構成するために使用されるデリゲートを追加します。

ConfigurePrimaryHttpMessageHandler(IHttpClientBuilder, Action<HttpMessageHandler,IServiceProvider>)

名前付き HttpClient に対してプライマリ HttpMessageHandler を構成するために使用されるデリゲートを追加します。

ConfigurePrimaryHttpMessageHandler(IHttpClientBuilder, Func<IServiceProvider,HttpMessageHandler>)

名前付き HttpClient に対してプライマリ HttpMessageHandler を構成するために使用されるデリゲートを追加します。

ConfigurePrimaryHttpMessageHandler(IHttpClientBuilder, Func<HttpMessageHandler>)

名前付き HttpClient に対してプライマリ HttpMessageHandler を構成するために使用されるデリゲートを追加します。

ConfigurePrimaryHttpMessageHandler<THandler>(IHttpClientBuilder)

名前付き HttpClient に対して、依存関係挿入コンテナーからプライマリ HttpMessageHandler を構成します。

RedactLoggedHeaders(IHttpClientBuilder, IEnumerable<String>)

ログ記録する前に値を編集する必要がある HTTP ヘッダー名のコレクションを設定します。

RedactLoggedHeaders(IHttpClientBuilder, Func<String,Boolean>)

ログ記録の前に HTTP ヘッダーの値を編集するかどうかを決定する Func<T,TResult> を設定します。

RemoveAllLoggers(IHttpClientBuilder)

既定のものを含め、以前に追加されたすべてのロガーを削除 HttpClientします。

SetHandlerLifetime(IHttpClientBuilder, TimeSpan)

HttpMessageHandler を再利用できる時間を設定します。 名前付きの各クライアントには、独自の構成済みハンドラーの有効期間の値を設定できます。 既定値は 2 分です。 ハンドラーの有効期限を無効にするには、有効期間を InfiniteTimeSpan に設定します。

UseSocketsHttpHandler(IHttpClientBuilder, Action<ISocketsHttpHandlerBuilder>)

名前付きの HttpClient のプライマリ ハンドラーとして を追加または更新SocketsHttpHandlerし、 を使用してISocketsHttpHandlerBuilder構成します。

UseSocketsHttpHandler(IHttpClientBuilder, Action<SocketsHttpHandler,IServiceProvider>)

という名前HttpClientの のプライマリ ハンドラーとして を追加または更新SocketsHttpHandlerします。 指定した場合は、プライマリ SocketsHttpHandlerを構成するために使用されるデリゲートも追加します。

AddExtendedHttpClientLogging(IHttpClientBuilder)

という名前HttpClientIHttpClientAsyncLogger の送信要求のログを出力する を追加します。

AddExtendedHttpClientLogging(IHttpClientBuilder, IConfigurationSection)

という名前HttpClientIHttpClientAsyncLogger の送信要求のログを出力する を追加します。

AddExtendedHttpClientLogging(IHttpClientBuilder, Action<LoggingOptions>)

という名前HttpClientIHttpClientAsyncLogger の送信要求のログを出力する を追加します。

AddPolicyHandler(IHttpClientBuilder, IAsyncPolicy<HttpResponseMessage>)

IAsyncPolicy`1 を指定して要求の実行を囲む PolicyHttpMessageHandler を追加します。

AddPolicyHandler(IHttpClientBuilder, Func<IServiceProvider,HttpRequestMessage,IAsyncPolicy<HttpResponseMessage>>)

policySelector から返されるポリシーを含む要求の実行を囲む PolicyHttpMessageHandler を追加します。

AddPolicyHandler(IHttpClientBuilder, Func<IServiceProvider,HttpRequestMessage, String,IAsyncPolicy<HttpResponseMessage>>, Func<HttpRequestMessage, String>)

PolicyHttpMessageHandler指定されたキー選択ロジック keySelectorpolicyFactoryを実行して返されるポリシーで要求の実行を囲む を追加します。

AddPolicyHandler(IHttpClientBuilder, Func<HttpRequestMessage,IAsyncPolicy<HttpResponseMessage>>)

policySelector から返されるポリシーを含む要求の実行を囲む PolicyHttpMessageHandler を追加します。

AddPolicyHandlerFromRegistry(IHttpClientBuilder, Func<IReadOnlyPolicyRegistry<String>,HttpRequestMessage,IAsyncPolicy<HttpResponseMessage>>)

IReadOnlyPolicyRegistry<TKey> から返されるポリシーを含む要求の実行を囲む PolicyHttpMessageHandler を追加します。

AddPolicyHandlerFromRegistry(IHttpClientBuilder, String)

IReadOnlyPolicyRegistry<TKey> から返されるポリシーを含む要求の実行を囲む PolicyHttpMessageHandler を追加します。

AddTransientHttpErrorPolicy(IHttpClientBuilder, Func<PolicyBuilder<HttpResponseMessage>,IAsyncPolicy<HttpResponseMessage>>)

指定した構成デリゲートを実行して作成された Policy を含む要求の実行を囲む PolicyHttpMessageHandler を追加します。 ポリシー ビルダーは、一時的な障害を示す条件で失敗した要求に対して、ポリシーの適用をトリガーするように事前構成されます。

AddResilienceHandler(IHttpClientBuilder, String, Action<ResiliencePipelineBuilder<HttpResponseMessage>,ResilienceHandlerContext>)

名前付きインライン回復性パイプラインを使用する回復性パイプライン ハンドラーを追加します。

AddResilienceHandler(IHttpClientBuilder, String, Action<ResiliencePipelineBuilder<HttpResponseMessage>>)

名前付きインライン回復性パイプラインを使用する回復性パイプライン ハンドラーを追加します。

AddStandardHedgingHandler(IHttpClientBuilder)

要求の実行を標準のヘッジ メカニズムでラップする標準のヘッジ ハンドラーを追加します。

AddStandardHedgingHandler(IHttpClientBuilder, Action<IRoutingStrategyBuilder>)

要求の実行を標準のヘッジ メカニズムでラップする標準のヘッジ ハンドラーを追加します。

AddStandardResilienceHandler(IHttpClientBuilder)

要求を送信し、一時的なエラーを処理するために、既定のオプションを使用して複数の回復性戦略を使用する標準の回復性ハンドラーを追加します。

AddStandardResilienceHandler(IHttpClientBuilder, IConfigurationSection)

要求を送信し、一時的なエラーを処理するために、既定のオプションを使用して複数の回復性戦略を使用する標準の回復性ハンドラーを追加します。

AddStandardResilienceHandler(IHttpClientBuilder, Action<HttpStandardResilienceOptions>)

要求を送信し、一時的なエラーを処理するために、既定のオプションを使用して複数の回復性戦略を使用する標準の回復性ハンドラーを追加します。

適用対象