HttpError503Handler Class
- Namespace
- Kampute.HttpClient.ErrorHandlers
- Assembly
- Kampute.HttpClient.dll
Definition
Handles '503 Service Unavailable' responses by retrying the request after a delay.
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 handler handles the '503 Service Unavailable' status code only.

If the first '503 Service Unavailable' response of a call has a
Retry-Afterheader, the request is retried once, at the time the header suggests; a repeated 503 response then reaches the caller. Without the header, the request is retried as the HttpRestClient.RetryPolicy of the client decides. RetryableHttpErrorHandler.OnRetryPolicy can choose another policy. If a suggested time is further away than RetryableHttpErrorHandler.MaxRetryDelay, which is five minutes by default, the request is not retried. See RetryableHttpErrorHandler for how the retries of a call are decided.