Deli z drugimi prek


PollyHttpClientBuilderExtensions Class

Definition

Extensions methods for configuring PolicyHttpMessageHandler message handlers as part of and HttpClient message handler pipeline.

public ref class PollyHttpClientBuilderExtensions abstract sealed
public static class PollyHttpClientBuilderExtensions
type PollyHttpClientBuilderExtensions = class
Public Module PollyHttpClientBuilderExtensions
Inheritance
PollyHttpClientBuilderExtensions

Methods

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

Adds a PolicyHttpMessageHandler which will surround request execution with a policy returned by the policySelector.

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

Adds a PolicyHttpMessageHandler which will surround request execution with a policy returned by the policySelector.

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

Adds a PolicyHttpMessageHandler which will surround request execution with a policy returned by executing provided key selection logic keySelector and policyFactory.

AddPolicyHandler(IHttpClientBuilder, IAsyncPolicy<HttpResponseMessage>)

Adds a PolicyHttpMessageHandler which will surround request execution with the provided IAsyncPolicy`1.

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

Adds a PolicyHttpMessageHandler which will surround request execution with a policy returned by the IReadOnlyPolicyRegistry<TKey>.

AddPolicyHandlerFromRegistry(IHttpClientBuilder, String)

Adds a PolicyHttpMessageHandler which will surround request execution with a policy returned by the IReadOnlyPolicyRegistry<TKey>.

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

Adds a PolicyHttpMessageHandler which will surround request execution with a Policy created by executing the provided configuration delegate. The policy builder will be preconfigured to trigger application of the policy for requests that fail with conditions that indicate a transient failure.

Applies to