200 OK

The HTTP status meaning the request worked and the body holds the answer.

In more detail

Only use 200 when there really is a result. A 200 with an empty body for something that does not exist misleads clients and caches into treating it as a real result.

Example

In the APIs course: The course fault that answers 200 with an empty object for a missing task shows why: clients and caches treat it as a valid representation and cannot tell that nothing was found.

Related terms

Taught in

References