Detailed explanation of 10 common HTTP status codes

Detailed explanation of 10 common HTTP status codes

The HTTP status code is a 3-digit code used to indicate the HTTP response status of a web server.

The first digit of all status codes represents one of five statuses of the response.

When a user attempts to access content on a running host through the HTTP or FTP protocol, the Web server returns a numeric code indicating the status of the request.

This status code is recorded in the server log and may also be displayed in a web browser or FTP client.

That is, when an error occurs when we open the page, the error message code displayed by the browser. Status codes can indicate whether a specific request was successful or not, and can also reveal the exact reason why a request failed.

The meanings of HTTP protocol status codes are mainly divided into five categories, which are:

1××: Reserved

2××: Indicates that the request was successfully received

3××: To complete the request, the customer needs to further refine the request

4××: Customer error

5××: Server error

According to Google search statistics, the following are the most common errors, among which HTTP 500 errors are twice as likely to occur as 404 errors:

500 Internal Server Error

The definition of HTTP 500 error has proven that this is one of the most common HTTP errors. Generally speaking, HTTP 500 errors occur when there is an error in the server's program code, or when an internal error occurs on the web server. For example, a web server will not be able to properly process access requests when it is overloaded.

404 File Not Found

Most people are aware of this mistake. A 404 error occurs when a user attempts to access a resource on a web server (usually a web page) that does not actually exist. A 404 error could be caused by a broken link, a misspelling in the URL, or because the web host has moved the requested page to another location (or deleted the requested page). Some websites set up custom pages to prevent the adverse effects of bad links.

403 Forbidden

A 403 error is similar to a 401 error, except that a 401 error is unauthorized, while a 403 error is forbidden. Any login will not work for 403 errors. A 403 error occurs when you try to access a (banned) website directory.

400 Bad Request

The web server returns the HTTP 400 error to tell the visitor that the program the visitor uses to access the website has an error or the access request has been damaged during the process.

401 Unauthorized

When a visitor attempts to access a restricted page but is not authorized, the website returns an HTTP 401 error. Incorrect login attempts are the main cause of this error.

200 Request successful

The request was successful and the expected response header or data body will be returned with this response.

206 Partial content

The server has successfully processed part of the GET request. HTTP download tools like FlashGet or Xunlei use this type of response to resume downloading, or to split a large document into multiple download segments and download them simultaneously.

301 Permanent Redirect

The requested resource has been permanently moved to a new location, and any future references to this resource SHOULD use one of the URIs returned in this response.

302 Temporary Redirect

The requested resource is now temporarily responding to the request from a different URI. Since such a redirection is temporary, the client SHOULD continue to send subsequent requests to the original address.

502 Bad Gateway

The server, acting as a gateway or proxy, received an invalid response from an upstream server while attempting to perform a request.

For more information about HTTP status codes, please refer to the following related articles list.

You may also be interested in:
  • Summary of the method of 301 redirection of domain names under Nginx
  • Apache Rewrite implements URL 301 redirection and domain name redirection
  • A more detailed solution to the problem of Win2003 IIS6.0 301 redirect with parameters
  • How to set up 301 redirection under IIS7.5 (and a pseudo-static 301 redirection error case)
  • PHP 301 redirection implementation code
  • How to set 301 Redirect permanent redirection in IIS
  • PHP implements 301 redirect jump example code
  • HTTP Error 500.19- Internal Server Error Error Solution
  • nginx prompt: Solution to 500 Internal Server Error
  • HTTP Error 500.19 Solution (Duplicate node defined)
  • Summary of http status codes and problem experience
  • JavaScript Learning Notes (VII) Ajax and Http Status Code
  • Solution to return 302 HTTP status code when setting 404 page in ASP.NET
  • List of http status codes
  • PHP implementation code for obtaining the HTTP status code of the accessed page
  • The front end gets the return value of the http status code 400
  • HTTP status code explanation

<<:  JavaScript clicks the button to generate a 4-digit random verification code

>>:  Basic operations of mysql learning notes table

Recommend

JS Easy to understand Function and Constructor

Table of contents 1. Overview 1.1 Creating a func...

Based on JavaScript ES new features let and const keywords

Table of contents 1. let keyword 1.1 Basic Usage ...

jQuery+swiper component realizes the timeline sliding year tab switching effect

Result: Implementation code: Need to be used with...

JavaScript counts the number of times a character appears

This article example shares the specific code of ...

Practical MySQL + PostgreSQL batch insert update insertOrUpdate

Table of contents 1. Baidu Encyclopedia 1. MySQL ...

MySQL 8.0.17 installation graphic tutorial

This article shares with you the MySQL 8.0.17 ins...

Summary of commonly used SQL in MySQL operation tables

1. View the types of fields in the table describe...

Description of the default transaction isolation level of mysql and oracle

1. Transaction characteristics (ACID) (1) Atomici...

Gitlab practical tutorial uses git config for related configuration operations

This article introduces the content related to gi...

Websocket+Vuex implements a real-time chat software

Table of contents Preface 1. The effect is as sho...

Vue3.0+vite2 implements dynamic asynchronous component lazy loading

Table of contents Create a Vite project Creating ...

View the dependent libraries of so or executable programs under linux

View the dependent libraries of so or executable ...

Detailed analysis of MySQL master-slave replication

Preface: In MySQL, the master-slave architecture ...