C# Класс WebApiThrottle.ThrottlingHandler

Наследование: System.Net.Http.DelegatingHandler
Показать файл Открыть проект

Открытые методы

Метод Описание
ThrottlingHandler ( ) : System

Initializes a new instance of the ThrottlingHandler class. By default, the QuotaExceededResponseCode property is set to 429 (Too Many Requests).

ThrottlingHandler ( WebApiThrottle.ThrottlePolicy policy, IPolicyRepository policyRepository, IThrottleRepository repository, IThrottleLogger logger, IIpAddressParser ipAddressParser = null ) : System

Initializes a new instance of the ThrottlingHandler class. Persists the policy object in cache using IPolicyRepository implementation. The policy object can be updated by ThrottleManager at runtime.

Защищенные методы

Метод Описание
ComputeThrottleKey ( RequestIdentity requestIdentity, RateLimitPeriod period ) : string
GetClientIp ( HttpRequestMessage request ) : IPAddress
QuotaExceededResponse ( HttpRequestMessage request, object content, HttpStatusCode responseCode, string retryAfter ) : Task
SendAsync ( HttpRequestMessage request, CancellationToken cancellationToken ) : Task
SetIdentity ( HttpRequestMessage request ) : RequestIdentity

Описание методов

ComputeThrottleKey() защищенный Метод

protected ComputeThrottleKey ( RequestIdentity requestIdentity, RateLimitPeriod period ) : string
requestIdentity RequestIdentity
period RateLimitPeriod
Результат string

GetClientIp() защищенный Метод

protected GetClientIp ( HttpRequestMessage request ) : IPAddress
request System.Net.Http.HttpRequestMessage
Результат System.Net.IPAddress

QuotaExceededResponse() защищенный Метод

protected QuotaExceededResponse ( HttpRequestMessage request, object content, HttpStatusCode responseCode, string retryAfter ) : Task
request System.Net.Http.HttpRequestMessage
content object
responseCode HttpStatusCode
retryAfter string
Результат Task

SendAsync() защищенный Метод

protected SendAsync ( HttpRequestMessage request, CancellationToken cancellationToken ) : Task
request System.Net.Http.HttpRequestMessage
cancellationToken System.Threading.CancellationToken
Результат Task

SetIdentity() защищенный Метод

protected SetIdentity ( HttpRequestMessage request ) : RequestIdentity
request System.Net.Http.HttpRequestMessage
Результат RequestIdentity

ThrottlingHandler() публичный Метод

Initializes a new instance of the ThrottlingHandler class. By default, the QuotaExceededResponseCode property is set to 429 (Too Many Requests).
public ThrottlingHandler ( ) : System
Результат System

ThrottlingHandler() публичный Метод

Initializes a new instance of the ThrottlingHandler class. Persists the policy object in cache using IPolicyRepository implementation. The policy object can be updated by ThrottleManager at runtime.
public ThrottlingHandler ( WebApiThrottle.ThrottlePolicy policy, IPolicyRepository policyRepository, IThrottleRepository repository, IThrottleLogger logger, IIpAddressParser ipAddressParser = null ) : System
policy WebApiThrottle.ThrottlePolicy /// The policy. ///
policyRepository IPolicyRepository /// The policy repository. ///
repository IThrottleRepository /// The repository. ///
logger IThrottleLogger /// The logger. ///
ipAddressParser IIpAddressParser /// The IpAddressParser ///
Результат System