New in 2.4: Test runs you can trust See what's new →

レート制限

レート制限。429 と Retry-After の処理をテストするための、本物の固定ウィンドウ方式のリミッター(クライアントごとに 60 秒あたり 5 リクエスト)です。クライアントは X-Client-Id ヘッダーで、なければ IP で識別されます。

リクエストの例

Make a rate-limited request that counts toward the limit. 完全なリファレンスと Send ボタン(英語).

cURL
curl -X GET "https://api.testingapis.com/api/RateLimit" \
  -H "X-Client-Id: docs-demo"
Studio で実行
レスポンス · 200 OK
{
  "message": "Request allowed.",
  "clientId": "id:docs-demo",
  "used": 1,
  "remaining": 4,
  "limit": 5,
  "windowSeconds": 60
}