Class RateLimitingHandler
- Namespace
- Autodesk.Common.HttpClientLibrary
- Assembly
- Autodesk.Common.HttpClientLibrary.dll
public class RateLimitingHandler : DelegatingHandler, IDisposable
- Inheritance
-
RateLimitingHandler
- Implements
- Inherited Members
Constructors
RateLimitingHandler(HttpMessageHandler, int, TimeSpan?)
public RateLimitingHandler(HttpMessageHandler innerHandler, int maxRequests, TimeSpan? timeWindow = null)
Parameters
innerHandler
HttpMessageHandlermaxRequests
inttimeWindow
TimeSpan?
Methods
SendAsync(HttpRequestMessage, CancellationToken)
Sends an HTTP request to the inner handler to send to the server as an asynchronous operation.
protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
Parameters
request
HttpRequestMessageThe HTTP request message to send to the server.
cancellationToken
CancellationTokenA cancellation token to cancel operation.
Returns
- Task<HttpResponseMessage>
The task object representing the asynchronous operation.
Exceptions
- ArgumentNullException
The
request
was null.