Search Results for

    Show / Hide Table of Contents

    Class ThrottleAttribute

    rate limit requests to this endpoint based on a request http header sent by the client.

    Inheritance
    object
    Attribute
    ThrottleAttribute
    Inherited Members
    Attribute.Equals(object)
    Attribute.GetCustomAttribute(Assembly, Type)
    Attribute.GetCustomAttribute(Assembly, Type, bool)
    Attribute.GetCustomAttribute(MemberInfo, Type)
    Attribute.GetCustomAttribute(MemberInfo, Type, bool)
    Attribute.GetCustomAttribute(Module, Type)
    Attribute.GetCustomAttribute(Module, Type, bool)
    Attribute.GetCustomAttribute(ParameterInfo, Type)
    Attribute.GetCustomAttribute(ParameterInfo, Type, bool)
    Attribute.GetCustomAttributes(Assembly)
    Attribute.GetCustomAttributes(Assembly, bool)
    Attribute.GetCustomAttributes(Assembly, Type)
    Attribute.GetCustomAttributes(Assembly, Type, bool)
    Attribute.GetCustomAttributes(MemberInfo)
    Attribute.GetCustomAttributes(MemberInfo, bool)
    Attribute.GetCustomAttributes(MemberInfo, Type)
    Attribute.GetCustomAttributes(MemberInfo, Type, bool)
    Attribute.GetCustomAttributes(Module)
    Attribute.GetCustomAttributes(Module, bool)
    Attribute.GetCustomAttributes(Module, Type)
    Attribute.GetCustomAttributes(Module, Type, bool)
    Attribute.GetCustomAttributes(ParameterInfo)
    Attribute.GetCustomAttributes(ParameterInfo, bool)
    Attribute.GetCustomAttributes(ParameterInfo, Type)
    Attribute.GetCustomAttributes(ParameterInfo, Type, bool)
    Attribute.GetHashCode()
    Attribute.IsDefaultAttribute()
    Attribute.IsDefined(Assembly, Type)
    Attribute.IsDefined(Assembly, Type, bool)
    Attribute.IsDefined(MemberInfo, Type)
    Attribute.IsDefined(MemberInfo, Type, bool)
    Attribute.IsDefined(Module, Type)
    Attribute.IsDefined(Module, Type, bool)
    Attribute.IsDefined(ParameterInfo, Type)
    Attribute.IsDefined(ParameterInfo, Type, bool)
    Attribute.Match(object)
    Attribute.TypeId
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: FastEndpoints
    Assembly: FastEndpoints.Attributes.dll
    Syntax
    [AttributeUsage(AttributeTargets.Class, Inherited = false)]
    public sealed class ThrottleAttribute : Attribute

    Constructors

    ThrottleAttribute(int, double, string?)

    rate limit requests to this endpoint based on a request http header sent by the client.

    Declaration
    public ThrottleAttribute(int hitLimit, double durationSeconds, string? headerName = null)
    Parameters
    Type Name Description
    int hitLimit

    how many requests are allowed within the given duration

    double durationSeconds

    the frequency in seconds where the accrued hit count should be reset

    string headerName

    the name of the request header used to uniquely identify clients. header name can also be configured globally using app.UseFastEndpoints(c=> c.ThrottleOptions...) not specifying a header name will first look for 'X-Forwarded-For' header and if not present, will use HttpContext.Connection.RemoteIpAddress.

    Properties

    DurationSeconds

    the frequency in seconds where the accrued hit count should be reset

    Declaration
    public double DurationSeconds { get; set; }
    Property Value
    Type Description
    double

    HeaderName

    the name of the request header used to uniquely identify clients. header name can also be configured globally using app.UseFastEndpoints(c=> c.Throttle...) not specifying a header name will first look for 'X-Forwarded-For' header and if not present, will use HttpContext.Connection.RemoteIpAddress.

    Declaration
    public string? HeaderName { get; set; }
    Property Value
    Type Description
    string

    HitLimit

    how many requests are allowed within the given duration

    Declaration
    public int HitLimit { get; set; }
    Property Value
    Type Description
    int
    In this article
    Back to top Developed by Đĵ ΝιΓΞΗΛψΚ and contributors / Licensed under MIT / Website generated by DocFX