Skip to content

[HttpClient] Make the client aware of throttling / rate limits #37471

@NicoHaase

Description

@NicoHaase

Description
When making API requests, some providers implement rate limits: for example, an API might define that you can only perform 50 requests in five seconds. All exceeding requests will be answered with error code 429 ("Too many requests").

Currently, this error is not caught or handled anywhere. A future solution could catch this directly somewhere in the core HttpClient and react to it: simply wait for some time (maybe the response's headers already tell you how long to wait?) and retry the request.

@nicolas-grekas already provided the first steps in #36779, and I'd like to see how this could help to resolve 429 responses

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy