Class RateLimitRejectionContext
Provides the details of a request that rate limiting rejected to the function that returns the message of its error (see SetApiRejectionResponse(RateLimiterOptions, Func<RateLimitRejectionContext, string>)).
Namespace: Singulink.Net.Http.Api.Service
Assembly: Singulink.Net.Http.Api.Service.dll
Syntax
public sealed class RateLimitRejectionContext
Constructors
| Name | Description |
|---|---|
| RateLimitRejectionContext(HttpContext, string?, TimeSpan?) | Initializes a new instance of the RateLimitRejectionContext class. |
Properties
| Name | Description |
|---|---|
| HttpContext | Gets the context of the rejected request. |
| RejectionMessage | Gets the RejectionMessage of the per-client limit that rejected the request, or null if the limit has none or another limiter rejected the request. |
| RetryAfter | Gets how long the client should wait before it tries again, or null if the limiter that rejected the request doesn't report it.
For the per-client limits, it is the time until their next window starts. The error carries it as RetryAfter, and the
response's |