Share via


ResilienceHttpClientBuilderExtensions.AddResilienceHandler Method

Definition

Overloads

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

Adds a resilience pipeline handler that uses a named inline resilience pipeline.

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

Adds a resilience pipeline handler that uses a named inline resilience pipeline.

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

Source:
ResilienceHttpClientBuilderExtensions.Resilience.cs

Adds a resilience pipeline handler that uses a named inline resilience pipeline.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Http::Resilience::IHttpResiliencePipelineBuilder ^ AddResilienceHandler(Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ builder, System::String ^ pipelineName, Action<Polly::ResiliencePipelineBuilder<System::Net::Http::HttpResponseMessage ^> ^, Microsoft::Extensions::Http::Resilience::ResilienceHandlerContext ^> ^ configure);
public static Microsoft.Extensions.Http.Resilience.IHttpResiliencePipelineBuilder AddResilienceHandler (this Microsoft.Extensions.DependencyInjection.IHttpClientBuilder builder, string pipelineName, Action<Polly.ResiliencePipelineBuilder<System.Net.Http.HttpResponseMessage>,Microsoft.Extensions.Http.Resilience.ResilienceHandlerContext> configure);
static member AddResilienceHandler : Microsoft.Extensions.DependencyInjection.IHttpClientBuilder * string * Action<Polly.ResiliencePipelineBuilder<System.Net.Http.HttpResponseMessage>, Microsoft.Extensions.Http.Resilience.ResilienceHandlerContext> -> Microsoft.Extensions.Http.Resilience.IHttpResiliencePipelineBuilder
<Extension()>
Public Function AddResilienceHandler (builder As IHttpClientBuilder, pipelineName As String, configure As Action(Of ResiliencePipelineBuilder(Of HttpResponseMessage), ResilienceHandlerContext)) As IHttpResiliencePipelineBuilder

Parameters

builder
IHttpClientBuilder

The builder instance.

pipelineName
String

The custom identifier for the resilience pipeline, used in the name of the pipeline.

configure
Action<ResiliencePipelineBuilder<HttpResponseMessage>,ResilienceHandlerContext>

The callback that configures the pipeline.

Returns

The value of builder.

Remarks

The final pipeline name is combination of Name and pipelineName. Use pipeline name identifier if your HTTP client contains multiple resilience handlers.

Applies to

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

Source:
ResilienceHttpClientBuilderExtensions.Resilience.cs

Adds a resilience pipeline handler that uses a named inline resilience pipeline.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Http::Resilience::IHttpResiliencePipelineBuilder ^ AddResilienceHandler(Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ builder, System::String ^ pipelineName, Action<Polly::ResiliencePipelineBuilder<System::Net::Http::HttpResponseMessage ^> ^> ^ configure);
public static Microsoft.Extensions.Http.Resilience.IHttpResiliencePipelineBuilder AddResilienceHandler (this Microsoft.Extensions.DependencyInjection.IHttpClientBuilder builder, string pipelineName, Action<Polly.ResiliencePipelineBuilder<System.Net.Http.HttpResponseMessage>> configure);
static member AddResilienceHandler : Microsoft.Extensions.DependencyInjection.IHttpClientBuilder * string * Action<Polly.ResiliencePipelineBuilder<System.Net.Http.HttpResponseMessage>> -> Microsoft.Extensions.Http.Resilience.IHttpResiliencePipelineBuilder
<Extension()>
Public Function AddResilienceHandler (builder As IHttpClientBuilder, pipelineName As String, configure As Action(Of ResiliencePipelineBuilder(Of HttpResponseMessage))) As IHttpResiliencePipelineBuilder

Parameters

builder
IHttpClientBuilder

The builder instance.

pipelineName
String

The custom identifier for the resilience pipeline, used in the name of the pipeline.

configure
Action<ResiliencePipelineBuilder<HttpResponseMessage>>

The callback that configures the pipeline.

Returns

The value of builder.

Remarks

The final pipeline name is combination of Name and pipelineName. Use pipeline name identifier if your HTTP client contains multiple resilience handlers.

Applies to