Laravel Http Response Issues

Laravel Http Response Issues

    401 Http Response

    It happens because your http request header is containing wrong information. Like if you are sending a token and if the token is wrong, It will get 401. This is also known as Unauthorized.

    Or if your client needs token and and you are not sending it, you will get 401.

    You see Postman at the top right corner, returned Status:401 Unauthorized

    429 Http Response

    Let's see what 429 issues. It means a client (our app) is making too many requests per minute to Framework. It happens, framework and server both want to protect themselves. So it tells you are doing 429.

    It's a basic set up agaisnt DDoS attack. It restricts certain IP, how times they can can visit the framework.

    Well, we can tell Laravel framework that we want to certain limit for http request per minute. We could do the settings in app\Http\kernel.php file.

    From the above picture you may see I added a new value in the api list. Here I added throttle:180, 1

    This tells, Laravel framework that certain client from a certain IP can make up to 180 requests per minutes. You may do much less if you want.

     

    Recent posts