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…

1 year ago

Merrimu Reservoir drone images

Merrimu Reservoir from drone. Click images to view larger.

1 year ago

FTP getting array of file details such as size using PHP

Using FTP and PHP to get an array of file details such as size and…

2 years ago

Creating Laravel form requests

Creating and using Laravel form requests to create cleaner code, separation and reusability for your…

2 years ago

Improving the default Laravel login and register views

Improving the default Laravel login and register views in such a simple manner but making…

2 years ago

Laravel validation for checking if value exists in the database

Laravel validation for checking if a field value exists in the database. The validation rule…

2 years ago