I have a form that will be submitted to the server via ajax, using a plugin for this. When the form is not filled correctly (in case when missing a mandatory parameter), I want to return a JSON with an error message and an error status, so that in javascript, the plugin goes into error callback rather than success.
I know it must be one of the 4xx family, but I do not know which one.
It does not seem to be any of these:
-
404 - Not found: the resource exists so much that I can give POST to it
-
403 - Forbidden: I do not think so either
400 - Bad request: the request worked out so much that I returned a JSON
What status should I return?