How do I get my Web API HTTP status code?

In short, let’s remember the following things about HTTP status codes in Web API projects:

  1. Always return the appropriate status code, however you define “appropriate”.
  2. Use the shortcut methods (e.g. Ok() , NotFound() , etc.) …
  3. An action that returns void will send status code 204 No Content.

For More Information Please Refer: