HttpErrorHandlerResult Struct

Namespace
Kampute.HttpClient
Assembly
  • Kampute.HttpClient.dll

Definition

Represents the decision of an error handler: retry with a given request, or do not retry.
public readonly struct HttpErrorHandlerResult
Inheritance

Remarks

A NoRetry decision only means that this handler does not retry; the client then asks the next handler that can handle the status code.

Fields

NoRetry

The decision not to retry.
public static readonly HttpErrorHandlerResult NoRetry

Field Value

HttpErrorHandlerResult

RequestToRetry

The request to send as the retry, or null if the handler does not retry.
public readonly HttpRequestMessage RequestToRetry

Field Value

HttpRequestMessage

Methods

Retry(HttpRequestMessage)

Creates a decision to retry with the specified request.
public static HttpErrorHandlerResult Retry(HttpRequestMessage requestToRetry)

Parameters

requestToRetry HttpRequestMessage
The request to send, such as a clone of the failed request made with Clone(this HttpRequestMessage), or a new request.

Returns

HttpErrorHandlerResult
An HttpErrorHandlerResult whose RequestToRetry is requestToRetry.

Exceptions

ArgumentNullException
Thrown if requestToRetry is null.