レート制限
レート制限。429 と Retry-After の処理をテストするための、本物の固定ウィンドウ方式のリミッター(クライアントごとに 60 秒あたり 5 リクエスト)です。クライアントは X-Client-Id ヘッダーで、なければ IP で識別されます。
あなたのアカウントでこれらのエンドポイントが使えます。各エンドポイントのページの Try it でリクエストを送れます。
- GET
https://api.testingapis.com/api/RateLimitMake a rate-limited request that counts toward the limitMake a rate-limited request that counts toward the limit. - POST
https://api.testingapis.com/api/RateLimit/resetReset the caller's windowReset the caller's window. - GET
https://api.testingapis.com/api/RateLimit/statusShow the caller's current window without counting a requestShow the caller's current window without counting a request.
リクエストの例
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"レスポンス · 200 OK
{
"message": "Request allowed.",
"clientId": "id:docs-demo",
"used": 1,
"remaining": 4,
"limit": 5,
"windowSeconds": 60
}サインインして詳細を見る
これらのエンドポイントのパラメータ、リクエストとレスポンスの例、ライブの Try it パネルは、サインインしたメンバー向けです。アカウントは無料で、数秒で作成できます。