Returning HTTP Status Codes

Returning HTTP Status Codes: Returning HTTP Status Codes: an overview, Common HTTP Status Codes, Returning ResponseEntity<T>.

Updated

  1. Returning HTTP Status Codes: an overview (Apprentice): Why the default status codes (200 on success, 500 on any error) aren't enough, shown by a request for a category that doesn't exist and still gets 200.
  2. Common HTTP Status Codes (Apprentice): The status codes a REST API uses most, 200, 201, 204, 400, 401, 403, 404 and 500, and what each tells the client.
  3. Returning ResponseEntity<T> (Journeyman): Return a ResponseEntity from a controller method to choose the status code, for example 404 when a category isn't found and 500 when something fails.