SkillAgentSearch skills...

RateLimitHeaders

Parse IETF RateLimit headers for proactive rate limit awareness in .NET HttpClient and Polly pipelines.

Install / Use

/learn @Alos-no/RateLimitHeaders
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

RateLimitHeaders

Build Status Documentation License: MIT

NuGet (RateLimitHeaders) NuGet (RateLimitHeaders.Polly)

RateLimitHeaders is a .NET library for parsing IETF RateLimit headers and enabling proactive rate limit awareness in HTTP clients. It automatically delays requests before hitting 429 errors, integrates with Polly v8 resilience pipelines, and provides a drop-in DelegatingHandler for IHttpClientFactory.

Documentation | Getting Started | API Reference

Packages

| Package | Description | |---------|-------------| | RateLimitHeaders | Core library with IETF header parsing and IHttpClientFactory DelegatingHandler | | RateLimitHeaders.Polly | Polly v8 resilience pipeline integration |

dotnet add package RateLimitHeaders
dotnet add package RateLimitHeaders.Polly  # Optional: for Polly integration

Example

// Register with IHttpClientFactory
services.AddHttpClient("MyApi")
    .AddRateLimitAwareHandler(options =>
    {
        options.EnableProactiveThrottling = true;
        options.QuotaLowThreshold = 0.1; // Warn at 10% remaining
    })
    .AddStandardResilienceHandler();

// Or use with Polly resilience pipelines
var pipeline = new ResiliencePipelineBuilder<HttpResponseMessage>()
    .AddRateLimitHeaders(options => options.EnableProactiveThrottling = true)
    .AddRetry(new RetryStrategyOptions<HttpResponseMessage>())
    .Build();

Features

  • IETF Standard Parsing - Parses RateLimit and RateLimit-Policy headers per draft-ietf-httpapi-ratelimit-headers-10

  • Proactive Throttling - Automatically delays requests when quota is low, preventing 429 errors before they happen

  • Polly Integration - Works seamlessly with Polly v8 resilience pipelines alongside retry and circuit breaker strategies

  • DelegatingHandler - Drop-in handler for IHttpClientFactory with full dependency injection support

  • Extensible - Implement IThrottlingAlgorithm for custom throttling strategies

  • Observable - Callbacks for rate limit info, quota warnings, and throttling events

Get Started

<div align="center">

📚 Ready to dive in?

Explore the Full Documentation →

Comprehensive guides, configuration options, custom algorithms, and more.

</div>

Supported Frameworks

| Package | .NET 8 | .NET 9 | .NET 10 | |---------|:------:|:------:|:-------:| | RateLimitHeaders | Yes | Yes | Yes | | RateLimitHeaders.Polly | Yes | Yes | Yes |

Contributing

We welcome contributions! Whether it's bug reports, feature requests, or code contributions.

License

This project is licensed under the MIT License.

Related Projects

Related Skills

View on GitHub
GitHub Stars32
CategoryDevelopment
Updated1mo ago
Forks0

Languages

C#

Security Score

90/100

Audited on Feb 28, 2026

No findings