HttpError503Handler Class
- Namespace
- Kampute.HttpClient.ErrorHandlers
- Assembly
- Kampute.HttpClient.dll
Definition
Handles '503 Service Unavailable' HTTP responses by attempting to back off and retry the request according to a specified or default backoff strategy.
public class HttpError503Handler : RetryableHttpErrorHandler- Inheritance
- object
- RetryableHttpErrorHandler
- HttpError503Handler
Remarks
Methods
CanHandle(HttpStatusCode)
Determines whether this handler can process the specified HTTP status code.
public sealed override bool CanHandle(HttpStatusCode statusCode)Parameters
statusCodeHttpStatusCode- The HTTP status code to evaluate.
Returns
Remarks
This implementation specifically handles the HTTP '503 Service Unavailable' status code.

This handler provides a mechanism to respond to HTTP 503 errors by retrying the request after a delay. The delay duration and retry logic can be customized through the RetryableHttpErrorHandler.OnBackoffStrategy delegate. If the delegate is not provided, or does not specify a strategy, the handler will look for a
Retry-Afterheader in the response. If theRetry-Afterheader is present, its value is used to determine the backoff duration. If the header is not present, the default backoff strategy of the HttpRestClient is used.