Home  >  Article  >  What are the common http status codes?

What are the common http status codes?

百草
百草Original
2023-10-12 16:20:211251browse

Common http status codes include 100, 200, 201, 204, 301, 302, 304, 400, 401, 404, 500, 503, etc. Detailed introduction: 1. 100, the server has received part of the request, and the client should continue to send the remaining request; 2. 200, the request is successful, the server has successfully processed the request; 3. 201, the request has been successfully processed, and A new resource is created on the server; 4, 204, the server successfully processed the request, but did not return anything, etc.

What are the common http status codes?

The operating system for this tutorial: Windows 10 system, DELL G3 computer.

HTTP status code refers to a three-digit code in the HTTP protocol used to indicate the server's processing result of the request. They are divided into five categories, namely 1xx, 2xx, 3xx, 4xx and 5xx. Some common HTTP status codes are introduced below.

1. 1xx (informational status code): These status codes indicate that the request has been received and processing continues.

- 100 (Continue): The server has received part of the request and the client should continue sending the remaining request.

2. 2xx (success status code): These status codes indicate that the request has been successfully received, understood, and processed by the server.

- 200 (OK): The request was successful and the server has successfully processed the request.

- 201 (Created): The request has been successfully processed and a new resource was created on the server.

- 204 (No Content): The server successfully processed the request but did not return any content.

3. 3xx (Redirect status code): These status codes indicate that further action from the client is required to complete the request.

- 301 (Moved Permanently): The requested resource has been permanently moved to a new location.

- 302 (Found): The requested resource has been temporarily moved to a new location.

- 304 (Not Modified): The client can use the cached version without re-fetching the resource from the server.

4. 4xx (client error status code): These status codes indicate that the request sent by the client has an error.

- 400 (Bad Request): The server cannot understand the syntax of the request.

- 401 (Unauthorized): The request requires user authentication.

- 404 (Not Found): The server cannot find the requested resource.

5. 5xx (Server Error Status Code): These status codes indicate that an internal error occurred while the server was processing the request.

- 500 (Internal Server Error): The server encountered an unexpected error.

- 503 (Service Unavailable): The server is temporarily unable to process the request and may return to normal after a period of time.

These are some common representative status codes in HTTP status codes. Through these status codes, the client can understand the server's processing results of the request and handle it accordingly. During development and debugging, it is very helpful to understand these status codes

The above is the detailed content of What are the common http status codes?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn