5.36Setting the Request Interface Quota Key
Updated on Aug 20, 2026~3 min read
Specifies a quota key for the current request, used to associate it with the quota limit rules configured in HttpClientOptions.
HTTP declarative requests set the request interface quota key through the QuotaKeyAttribute attribute. The corresponding HTTP declarative extractor implementation is the QuotaKeyDeclarativeExtractor type, which is responsible for parsing the QuotaKeyAttribute attribute and building the request interface quota key configuration required by the HttpRequestBuilder instance.
// Applied at the interface definition, affecting all methods[QuotaKey("weixin")]public interface IHttpService : IHttpDeclarative{ [Get("https://furion.net/")] Task<string> GetStringAsync(); // Applied at the method level [QuotaKey("qq")] [Get("https://furion.net/")] Task<string> GetStringAsync();}QuotaKeyAttribute contains the following constructors and properties:
-
Constructors:
new(key): Applies to methods or interfaces, setting the request interface quota key.
-
Properties:
Key: The quota key (of typestring).