Skip to content

Provide rate limit http header to parse rate limits and create header values #121302

@Spaier

Description

@Spaier

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

I am creating a throttler for my own code, based on rate limit headers returned from several services and had to implement code that parses rate limits from headers which seems to be a standard https://datatracker.ietf.org/doc/draft-ietf-httpapi-ratelimit-headers/.
Headers that I use: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset

Describe the solution you'd like

Since we already have AuthenticationHeaderValue and HttpRequestMessage.Headers.Authorization I think it might make sense to have RateLimitHeaderValue, RateLimitRemainingHeaderValue, RateLimitResetHeaderValue types defined somewhere in RateLimiting namespace and HttpRequestMessage.Headers.RateLimit extension that would return those values.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions