1

I have a PHP application that has a router that should have two default handlers for 401 Unauthorized and 404 Not Found.

But it could happen that no handlers were set for those two cases. In that case, I need to have a default response that tells Request Unhandled, I have set it to the response code 400 Bad Request, but I feel like its not truly appropriate.

What response code should I use for a unhandled request?

Informancien
  • 255
  • 3
  • 13
  • 2
    4xx is generally a client's problem. 5xx is your problem. So if you cannot handle a request - it is HTTP 5xx. For example - `501 Not Implemented` – zerkms Sep 01 '16 at 23:41

1 Answers1

5

4xx is generally a client's problem. 5xx is your (server-side) problem. So if you cannot handle a request - it is HTTP 5xx.

In this case it looks that 501 Not Implemented is the best fit.

References:

zerkms
  • 249,484
  • 69
  • 436
  • 539