What HTTP Status Codes Should We Use In Web API?



Every request we issue to the server, the server parses it and build the response to return the result to the client. As Web API is REST service, every response is represented with a state, a HTTP status should be semantically used to inform the client with result.

There are five types of HTTP status codes:

  1. Informational (1xx)
  2. Success (2xx)
  3. Redirection (3xx)
  4. Client errors (4xx)
  5. Server errors (5xx)

Every Group has its own details. For e.g., if during request all thing goes well, after GET request the status code of the response is 200 OK , but after a POST request is 201 CREATED.

Continue reading