http protocol status code

There are not many commonly used status codes, about 14 kinds.

Is the 1** class status code called Information status, indicating that information is being processed.

The 2** class status code is called the Success status code, indicating that the request is completed normally.

The 3** class status code is called the Redirection status code, which means that the client needs to perform additional operations (such as jump. Redirection)

The 4** class status codes are called Error status codes, which are usually caused by client errors.

The 5** class status is called the Server Error status code, which is usually caused by an error on the server side.

To summarize: Status codes are divided into client error status codes, server error status codes, success status codes, redirection status codes, etc.

 

1. 2** type status code

1. 200 ok means that the request sent from the client was correctly processed by the server and the request has been sent back.

2. The 204 No Content request has been successful, but no results (entities) have been returned. Usually using the php die() exit() function will raise a 204 status code.

3. 206 Partial Content range request status code.

    What is a range request. See the picture below to know.

    

    Some parts of the beauty picture above are not loaded. In fact, the Internet is used to load the picture with the range request. An image may have 1024k. If it is loaded at one time, the rendering speed of the page will be very slow, and the performance will be poor. After executing the asynchronous range request, load 256k images each time, and then render them and spliced ​​them out in sequence, and the loading speed will be significantly faster.

    The value of 206 above is that the http request performed a range request and only obtained a part of the resource.

2. 3** status code

  1. The 301 status code Moved Permanently indicates that the page resource you requested has now been moved, and you need to go to a new place to find the page. This is redirection, and there will be a location field value in the response header of the server to prompt.

   2. The 302 status code (Found) is the same as 301. It means that the page resource you requested has now been moved, and you have to go to the new place to find it. But the new place is not fixed, maybe it will be changed in a few days. Do not prompt users to save bookmarks, prompt users to jump.

   3. 303 status code. See other . Indicates that the page you requested contains the address of the resource you want to get. For example, you go to the doorman to pick up the courier. When you arrive at the doorman, the uncle said that the courier has been handed over to the front desk. This process returns a 303 status code.

   4. 304 Not Modified indicates that the resource has been found, but it has not been updated compared to the last time. The browser reads the cache.

   5. 307 Temporary Redirect Temporary redirection.

Three: 4** Client error.

   1. The syntax of the 400 Bad Request message is incorrect.

   2. 401 Unauthorized requires HTTP authentication (BASIC or DIGEST).

   3. 403 Forbidden directory and file permission errors will report this status code.

   4. 404 There is no such resource on the server, generally the path is wrong.

Four: 5** Server error.

   1. 500 Internal Server Error Server error, there may be an error in the WEB application.

    2. 503 Serveice Unavailable The server is overloaded.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324983173&siteId=291194637