Learn VisualLearn API

The First Digit Shows the Class of Outcome, and the Rest Names the Specific Result

The first digit of a status code shows its class, the category of the outcome. 2xx means success, 3xx means the client must take another step such as following a redirect, 4xx means the request itself has a problem, and 5xx means the request was fine but the server couldn't handle it.

Among the 2xx codes, you choose between three. 200 is a success with a body, 201 reports that a new resource was created, and 204 is a success with no body.

Among the 4xx codes, you choose by what the problem is. A request with a missing required field, a request pointing at a resource that doesn't exist, and a request that conflicts with the resource's current state each get a different code.

GOAL

Choose between 200, 201, and 204 for a successful response, and between 400, 401, 403, 404, 409, and 422 for a client error, based on what actually happened.

A client sends a request to create a user, but the email field is missing entirely. Which code fits best?