The main HTTP status codes

HTTP status codes are issued by a web server in response to a clients action. Simply going to a URL and fetching resources like images, styling and scripts will return status codes or if nothing was found at the URL you will get a status code for that.

The idea is each action will return a result (HTTP status code) for what the outcome was.

HTTP response types

The HTTP status codes can be grouped into basic types:

  • Starting at 100 is informational responses
  • Starting at 200 are successful repsonses
  • Redirects start at 300
  • Client errors at 400
  • Server errors start at 500.

Key HTTP response codes

200 Ok This response indicates the request was a success. This request could be for an image GET or even if a POST request was made successfully.

301 Moved permanently States that this url has changed permanently and should supply the new one.

303 See Other Actually redirects to another page not the URL that the request was made for.

400 Bad request The request could not be detirmined due to error.

401 Unauthorised Authentication or correct authentication needed.

403 Forbidden No rights to access, however the clients identidty is known.

404 Not found request can not be found. Common amongst the internet.

500 Internal server error Server error that it cannot handle.

You can view all the HTTP codes here.

Response codes have high importance in SEO and API aspects, Redirecting or stating that no content exists helps avoid getting penalties from crawler bots for poor content (lack of).

Getting authentication status and GET/POST responses are crucial with API usage. Knowing if your request worked or why it didnt obviously helps and is integural to the process.

Reality is that without HTTP response codes developers and users of the internet would not know what is happening and why.