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

What are the status codes of http?

百草
百草Original
2023-10-12 16:32:596967browse

http status codes include 100, 200, 201, 204, 301, 302, 304, 400, 401, 403, 404, 500, 502 and 503, etc. Detailed introduction: 1. 100, the server has received part of the request, and the client can continue to send the remaining request; 2. 200, the request has been successfully processed, and the requested resource has been returned; 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 status codes of http?

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

HTTP (Hypertext Transfer Protocol) is an application layer protocol used to transmit hypertext. During HTTP communication, the server will return a status code to the client to indicate the processing result of the request. Status codes consist of three digits, and each status code has a specific meaning. The following are common HTTP status codes and their meanings:

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

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

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

- 200 (Success): The request was successfully processed and the requested resource was returned.

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

- 204 (No Content): The server successfully processed the request but returned no content.

3xx (redirect status code): Indicates that further action is required to complete the request.

- 301 (Permanent Redirect): The requested resource has been permanently moved to a new URL.

- 302 (Temporary Redirect): The requested resource has been temporarily moved to a new URL.

- 304 (Unmodified): The client sends a conditional request, and the server determines that the resource has not changed and returns this status code.

4xx (client error status code): Indicates 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 authentication.

- 403 (Forbidden): The server denies the requested access.

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

5xx (server error status code): Indicates that an error occurred when the server processed the request.

- 500 (Server Internal Error): The server encountered an error while executing the request.

- 502 (Bad Gateway): The server, acting as a gateway or proxy, received an invalid response from an upstream server.

- 503 (Service Unavailable): The server is temporarily unable to handle requests, usually due to overload or maintenance.

In addition to the above common status codes, there are some other status codes, such as 206 (part of the content) indicates that the server successfully processed part of the request, 416 (request range does not meet the requirements) indicates that the requested range is invalid, etc. .

Understanding HTTP status codes is very important for developers and network administrators, which can help them determine whether the request is successful and handle errors accordingly. At the same time, for users, the status code can also provide some useful information. For example, the 404 status code indicates that the requested resource is not found, possibly due to an incorrect URL

being entered.

The above is the detailed content of What are the status codes of http?. 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

Related articles

See more