Mid ASP.NET Core

Returning appropriate HTTP status codes?

Use proper status codes:

  • 200 OK (success)
  • 201 Created (on POST)
  • 204 No Content (on DELETE)
  • 400 Bad Request
  • 401 Unauthorized / 403 Forbidden
  • 404 Not Found
  • 500 Internal Server Error

return Ok(result);

return NotFound();

return BadRequest(ModelState);

More from ASP.NET Core Tutorial

All questions for this course