Struct RateLimitEventArgs
- Namespace
- RateLimitHeaders.Events
- Assembly
- RateLimitHeaders.dll
Provides data for rate limit info events from the HTTP handler.
[SuppressMessage("Naming", "CA1711:Identifiers should not have incorrect suffix", Justification = "EventArgs suffix is intentional for event data records")]
public readonly record struct RateLimitEventArgs : IEquatable<RateLimitEventArgs>
- Implements
- Inherited Members
Remarks
Important: Do not store the Response reference beyond the callback scope. The response may be disposed after the callback completes. If you need response data for later use, extract the required information during the callback and store only that data.
Constructors
RateLimitEventArgs(RateLimitInfo, Uri?, HttpResponseMessage)
Provides data for rate limit info events from the HTTP handler.
public RateLimitEventArgs(RateLimitInfo RateLimitInfo, Uri? RequestUri, HttpResponseMessage Response)
Parameters
RateLimitInfoRateLimitInfoThe parsed rate limit information.
RequestUriUriThe URI of the request that triggered this event.
ResponseHttpResponseMessageThe HTTP response containing the rate limit headers.
Remarks
Important: Do not store the Response reference beyond the callback scope. The response may be disposed after the callback completes. If you need response data for later use, extract the required information during the callback and store only that data.
Properties
RateLimitInfo
The parsed rate limit information.
public RateLimitInfo RateLimitInfo { get; init; }
Property Value
RequestUri
The URI of the request that triggered this event.
public Uri? RequestUri { get; init; }
Property Value
Response
The HTTP response containing the rate limit headers.
public HttpResponseMessage Response { get; init; }