格 千格 KiloCell

HTTP Status Code Query

Quick query, understand and use HTTP response status code correctly

What's HTTP status code?

Core definitions

HTTP status code is the 3-bit digital code returned by the server in response to a client request. It's Web. The standard language of communication, informing the client of the outcome of the request.

Meaning of statistics

Each status code has a specific semantic by the IETF in the RFC Definition in the standard. The correct use of the state code is essential to construct a high-performance, scalable and easily debugged Web application.

Five major categories for the status code

The first number of the status code defines the category of response:

  • 1xx (information response) : The request has been received and is being processed.
  • 2xx (successful response) : Indicates that the request has been successfully received, understood and accepted by the server.
  • 3xx (redirected response) : Indicates that further operations by the client are required to complete the request.
  • 4xx (customer error) : indicates that the request contains an error syntax or cannot be completed, often caused by the front end.
  • 5xx (server error) : indicates that the server made an error in processing the request, usually the back end logic collapses.

Why should developers care about the status code?

The core benefits of HTTP state code acquisition are as follows:

  • Quick Debug : The question of whether the question is immediately determined is from the front-end parameter (4xx) or the back-end logic (5xx).
  • SEO Optimization : Search engine reptiles are highly dependent on state code (e.g. 301 redirected transmission weight).
  • I'm going to raise the experience. : Show friendly tips (e. g. 404 pages) for different errors.
  • API Code : Following standard status code makes API more self-depreciating.