Search Results for

    Show / Hide Table of Contents

    Class PictureparkRetryHandler

    Decorating HttpClientHandler which retries calls when HTTP 429 (Too many requests) is returned

    Inheritance
    object
    HttpMessageHandler
    DelegatingHandler
    PictureparkRetryHandler
    Inherited Members
    DelegatingHandler.Dispose(bool)
    DelegatingHandler.InnerHandler
    HttpMessageHandler.Dispose()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: System.Dynamic.ExpandoObject
    Syntax
    public class PictureparkRetryHandler : DelegatingHandler, IDisposable

    Constructors

    PictureparkRetryHandler(int)

    Initializes a new instance of the PictureparkRetryHandler class to handle throttled requests (HTTP 429 Too many requests). Uses the default HttpClientHandler inner handler.

    Declaration
    public PictureparkRetryHandler(int maxRetries = 3)
    Parameters
    int maxRetries

    Maximum number of retries before a request is failing.

    PictureparkRetryHandler(HttpMessageHandler, int)

    Initializes a new instance of the PictureparkRetryHandler class to handle throttled requests (HTTP 429 Too many requests). Adds an inner handler for further processing.

    Declaration
    public PictureparkRetryHandler(HttpMessageHandler innerHandler, int maxRetries = 3)
    Parameters
    HttpMessageHandler innerHandler

    The inner handler.

    int maxRetries

    Maximum number of retries before a request is failing.

    Methods

    SendAsync(HttpRequestMessage, CancellationToken)

    Sends an HTTP request to the inner handler to send to the server as an asynchronous operation. Retries the request up to the specified maximum retries when encountering a response with the status code 429.

    Declaration
    protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
    Parameters
    HttpRequestMessage request

    The HTTP request message to send to the server.

    CancellationToken cancellationToken

    A cancellation token to cancel operation.

    Returns
    Task<HttpResponseMessage>

    Returns Task<TResult>. The task object representing the asynchronous operation.

    Overrides
    DelegatingHandler.SendAsync(HttpRequestMessage, CancellationToken)
    Exceptions
    ArgumentNullException

    The request was null.

    Back to top Generated by DocFX