RateLimiterOptions Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Specifies options for the rate limiting middleware.
public sealed class RateLimiterOptions
type RateLimiterOptions = class
Public NotInheritable Class RateLimiterOptions
- Inheritance
-
RateLimiterOptions
Constructors
RateLimiterOptions() |
Properties
GlobalLimiter |
Gets or sets the global PartitionedRateLimiter<TResource> that will be applied on all requests. The global limiter will be executed first, followed by the endpoint-specific limiter, if one exists. |
OnRejected |
Gets or sets a Func<T1,T2,TResult> that handles requests rejected by this middleware. |
RejectionStatusCode |
Gets or sets the default status code to set on the response when a request is rejected. Defaults to Status503ServiceUnavailable. |
Methods
AddPolicy<TPartitionKey,TPolicy>(String) |
Adds a new rate limiting policy with the given policyName. |
AddPolicy<TPartitionKey>(String, Func<HttpContext,RateLimitPartition<TPartitionKey>>) |
Adds a new rate limiting policy with the given |
AddPolicy<TPartitionKey>(String, IRateLimiterPolicy<TPartitionKey>) |
Adds a new rate limiting policy with the given policyName. |