4

I can find ways to decrease the value but in my case I am running many asynchronous API calls and need to increase the X-RateLimit-Limit to something more than 100 to work.

Kindly suggest alternatives.

following is the response which I am getting

P.S - I am using auth middleware also


eHTTP/1.1 429 Too Many Requests

Date: Fri, 10 Mar 2017 11:18:24 GMT Server: Apache/2.4.17 (Win32) OpenSSL/1.0.2d PHP/5.5.35 X-Powered-By: PHP/5.5.35 Cache-Control: no-cache X-RateLimit-Limit: 60 X-RateLimit-Remaining: 0 Retry-After: 24 Set-Cookie: XSRF-TOKEN=eyJpdiI6ImtuSU5EMXo0YXlrSU1MWnVnUFRyeUE9PSIsInZhbHVlIjoicVVkMU55V2lkcHNvMkRqaFlCUFZnK3lcL0pRckNpcjMyZll3UkVaWXNEYWhSazdcL2Jub3M4QmtpZDhDQWVCZjhzWE5KV0paaGlZMGJOQ1J1TGNFYnhkdz09IiwibWFjIjoiZTNlNzY3MDc2ZWExMjBhZDI0MjA3NzNjYjE5YWU1NmIzZmEyY2RiOWI4NDBmOGI5MjVmN2E2ZTUzNDE3YjdmNyJ9; expires=Fri, 10-Mar-2017 13:18:25 GMT; Max-Age=7200; path=/ Set-Cookie: laravel_session=eyJpdiI6IkRoSWV2dzFHV3F5YUJNR2tCMEhKSUE9PSIsInZhbHVlIjoiTzdhOW12ZFozNnJtaW5vRFBHdFVZV1l2SDdXcEpvdEN6MGdRTkZsRzFoeU9yb2VXTDN5cVA0a1d5NnZ1MCtEMTRKNFRES1ZsODg5YmswY2F5cEN0c1E9PSIsIm1hYyI6ImY5YjYyMmNiNDE1YzgxYmQ3NzE5NjYyMTk0YmEzNzU2NTg4MzZhZWYyNDVjMWVkMzJmNzRiMmUwODFjYjRiYWMifQ%3D%3D; expires=Fri, 10-Mar-2017 13:18:25 GMT; Max-Age=7200; path=/; httponly Content-Length: 18 Keep-Alive: timeout=5, max=99 Connection: Keep-Alive Content-Type: text/html; charset=UTF-8

Too Many Attempts.

Vishal Pandey
  • 51
  • 1
  • 2
  • the `throttle` middleware accepts parameters to increase or decreate the rate limit. – online Thomas Mar 10 '17 at 11:59
  • Setting the throttle middleware greater than 60 is ignored. It is only working to throttle less than 60. Even when I change the default `$maxAttempts = 60`, it has no effect except for less than 60. – STWilson Apr 05 '17 at 14:50

2 Answers2

5

You can set throttling parameters as in the image:

enter image description here

Jakub Kratina
  • 644
  • 6
  • 14
4

Your attempt to do set the API thottle greater than 60 like the following will be usurped by the setting in app/Http/Kernel.php:

// routes/api.php
Route::get('myapi/{value}/{anothervalue}', 'MyApiController@getStuff')->middleware('throttle:100,1');

For the above to work, increase the limit in app/Http/Kernel.php according to your specific requirements:

    'api' => [
        'throttle:500,1',
        'bindings',
    ],
STWilson
  • 1,538
  • 2
  • 16
  • 26