What is the purpose of HTTP Status Code?

Posted by Editorial Staff | Updated on

HTTP Status code are standard codes and refers to predefined status of task done at server. For example, HTTP Status 404 states that requested resource is not present on server.

Below are some HTTP Status Code and meaning:

  • 200 – OK, shows success.
  • 201 – CREATED, when a resource is successful created using POST or PUT request. Return link to newly created resource using location header.
  • 304 – NOT MODIFIED, used to 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 invalid input is provided e.g. validation error, missing data.
  • 401 – FORBIDDEN, states that user is not having access to method being used for example, delete access without admin rights.
  • 404 – NOT FOUND, states that method is not available.
  • 409 – CONFLICT, states conflict situation while executing the method for example, adding duplicate entry.
  • 500 – INTERNAL SERVER ERROR, states that server has thrown some exception while executing the method.

If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers