I’m designing a REST API. What response should a server send to mean “I’ve got your request, parsed it and it’s valid, but I’m not not going to process it because you didn’t provide enough globs.”
IANA are never going to allocate a 4xx error code for this when there’s only 100 possible errors. I’ve looked over the 4xx list on wikipedia and they all have specific meanings, none meaning a general-purpose error for private APIs to use.
What should a server do when the client fails to provide enough globs?
UPDATE
I don’t think 400 is the right one. RFC2616 says:
10.4.1 400 Bad Request
The request could not be understood by the server due to malformed
syntax. The client SHOULD NOT repeat the request without
modifications.
This error seems to be intended for more fundamental errors of protocol rather than the class of error I’m thinking of. However, many people seem to (ab)using this code for this purpose anyway.
400 is a generic status code that is intended to capture a whole range of client errors. Use the “reason phrase” or the response body to further qualify the reason for the error.