Interface ThrottlingHeaders


@UnstableApi public interface ThrottlingHeaders
A RateLimit Header Scheme for HTTP.
  • Field Details

    • RATELIMIT

      static final ThrottlingHeaders RATELIMIT
      Describes RateLimit Header Fields for HTTP. For example:
      
       RateLimit-Limit: 10
       RateLimit-Remaining: 1
       RateLimit-Reset: 7
       
    • X_RATELIMIT

      static final ThrottlingHeaders X_RATELIMIT
      Describes an alternative RateLimit Header Scheme for HTTP, used by Github and Vimeo. For example:
      
       X-RateLimit-Limit: 10
       X-RateLimit-Remaining: 1
       X-RateLimit-Reset: 7
       
    • X_RATE_LIMIT

      static final ThrottlingHeaders X_RATE_LIMIT
      Describes another alternative RateLimit Header Scheme for HTTP, used by Twitter. For example:
      
       X-Rate-Limit-Limit: 10
       X-Rate-Limit-Remaining: 1
       X-Rate-Limit-Reset: 7
       
  • Method Details

    • limitHeader

      AsciiString limitHeader()
      Returns the name of the "limit" throttling header for the given scheme, like "X-RateLimit-Limit". This header specifies the requests quota for the given time window.
    • remainingHeader

      AsciiString remainingHeader()
      Returns the name of the "remaining" throttling header for the given scheme, like "X-RateLimit-Remaining". This header specifies the remaining requests quota for the current time window.
    • resetHeader

      AsciiString resetHeader()
      Returns the name of the "reset" throttling header for the given scheme, like "X-RateLimit-Reset". This header specifies the time remaining in the current window. Its value defined in seconds or as a timestamp.