IHttpRetryPolicy Interface

Namespace
Kampute.HttpClient.Interfaces
Assembly
  • Kampute.HttpClient.dll

Definition

Defines how failed HTTP requests are retried.
public interface IHttpRetryPolicy
Implemented by

Remarks

A policy creates a retry session for a call when its request first fails in a way the policy covers. The session decides, for that failure and the later ones of the same kind during the call, whether and when the request is retried. HttpRetryPolicy creates sessions from an IRetryStrategy, and HttpRetryPolicy.Dynamic(Func<HttpRequestErrorContext, IRetryStrategy>) chooses the strategy or the session from the failure.

Methods

CreateSession(HttpRequestErrorContext)

Creates the retry session for a failed HTTP request.
IRetrySession CreateSession(HttpRequestErrorContext ctx)

Parameters

ctx HttpRequestErrorContext
The context of the failure, with the client, the request and the error.

Returns

IRetrySession
The IRetrySession that decides whether and when the request is retried.

Exceptions

ArgumentNullException
Thrown if ctx is null.

See Also