Skip to content

HTTP Status Code

Mahmoud A. Zaid edited this page Mar 12, 2019 · 2 revisions

The Status-Code element in a server response, is a 3-digit integer where the first digit of the Status-Code defines the class of response and the last two digits do not have any categorization role. There are 5 values for the first digit:

1. 1xx: Informational

  • It means the request has been received and the process is continuing.

2. 2xx: Success

  • It means the action was successfully received, understood, and accepted.

3. 3xx: Redirection

  • It means further action must be taken in order to complete the request.

4. 4xx: Client Error

  • It means the request contains incorrect syntax or cannot be fulfilled.

5. 5xx: Server Error

  • It means the server failed to fulfill an apparently valid request.

The below is some of HTTP status code:

200 OK

  • shows success.

201 CREATED

  • Resource created successfully using

204 NO CONTENT

  • Response body is empty. For example, a DELETE request.

304 NOT MODIFIED

  • Reduce network bandwidth usage in case of conditional GET requests.
  • Response body should be empty.
  • Headers should have date, location, etc.

400 BAD REQUEST

  • States that an invalid input is provided.

401 Unauthorized

  • The requested page needs a username and a password.

403 FORBIDDEN

  • User is not having access to the method being used. For example, Delete access without admin rights.

404 Not Found

  • The server can not find the requested page.

409 CONFLICT

  • Conflict situation while executing the method. For example, adding duplicate entry.

500 INTERNAL SERVER ERROR

  • The server has thrown some exception while executing the method.
Clone this wiki locally