|
|
|
|
|
by jacobgreenleaf
2520 days ago
|
|
The HTTP IETF RFC (2616) states: > The first digit of the Status-Code defines the class of response. The last two digits do not have any categorization role. There are 5 values for the first digit: > - 4xx: Client Error - The request contains bad syntax or cannot be fulfilled What do you think status codes like 404, 405, 406 are for? You say they shouldn't be for "did the application successfully validate the user's input data" but status code 400 is explicitly for bad requests. In your view should a HTTP server ever return 4xx? |
|
Obviously if you send a TAIL method request, you should get a 405, and if you send Accept: eggs/*, you should get a 406. If a route doesn't exist, you should get a 404. If you fail HTTP basic auth, you should get a 403 (but why are you using HTTP basic auth?). If you want certain paths to never be accessed for some reason, you should return a 401.