Límite de frecuencia
Límite de frecuencia: un limitador real de ventana fija (5 peticiones cada 60 segundos por cliente) para probar el manejo de 429 y Retry-After. Los clientes se identifican por la cabecera X-Client-Id o, sin ella, por IP.
- GET
https://api.testingapis.com/api/RateLimitMake a rate-limited request that counts toward the limit. - POST
https://api.testingapis.com/api/RateLimit/resetReset the caller's window. - GET
https://api.testingapis.com/api/RateLimit/statusShow the caller's current window without counting a request.
Petición de ejemplo
Make a rate-limited request that counts toward the limit. Referencia completa y botón Send (en inglés).
cURL
curl -X GET "https://api.testingapis.com/api/RateLimit" \
-H "X-Client-Id: docs-demo"Respuesta · 200 OK
{
"message": "Request allowed.",
"clientId": "id:docs-demo",
"used": 1,
"remaining": 4,
"limit": 5,
"windowSeconds": 60
}