Categories: Development

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.

Share

Recent Posts

Kennington reservoir drained drone images

A drained and empty Kennington reservoir images from a drone in early July 2024. The…

2 years ago

Merrimu Reservoir drone images

Merrimu Reservoir from drone. Click images to view larger.

2 years ago

Early September spring shots

Some early September spring shots from a bushwalk, It is still too early for wildflowers.

3 years ago

Cloning an NVMe to SK Hynix Platinum P41 NVMe

I recently needed to clone over a smaller NVMe to a 2TB SK Hynix Platinum…

3 years ago

Using Laravel’s deleteDirectory to delete folders and their contents

If you ever needed a simple solution in Laravel to delete an entire directory and…

3 years ago

How to allow only 1 user to register in a Laravel application

How to enforce only one user to register or be registered in a Laravel web…

3 years ago