Classification and Definition of HTTP Status Return Codes

Source: Internet
Author: User
Keywords http status codes web server response codes http error 500
HTTP errors are mainly divided into three categories:
        User equipment problems, Web server problems, connection problems. When the client sends an HTTP request to the Web server, the server will return a response code.
Alibaba Cloud Simple Application Server:  Anti COVID-19 SME Enablement Program
$300 coupon package for all new SMEs and a $500 coupon for paying customers.

Five categories of Statuscodes are defined in HTTP status codes

Informational

HTTP status codes ranging from 100 to 199 are information report codes.

First, if a browser tries to visit a website, and the website returns these codes, they are often not displayed on the screen. They are just internal codes that the browser makes reference. In addition, another reason why these codes are not common is that the HTTP standard initially did not allow the use of status codes in this range.

Successful
The status code ranging from 200 to 299 is the operation success code.

These codes are used inside the browser to confirm the successful operation and the current request status. Although these codes are usually not displayed, there are some troubleshooting tools that can read them, just like most other HTTP status codes, they are very useful in the error diagnosis process.

Redirection
Status codes ranging from 300 to 399 are redirect codes.

Essentially, they tell the web browser that some other action must be performed to complete the request. Based on the characteristics of this command, it can be executed automatically or require additional user input. For example, the status code 301 indicates that a specific resource has been permanently removed first, so all future requests to access the resource should be directed to a specific URL.

Client Error
Status codes in the 400 range are client error codes. This type of error code is often security-related.

For example, if a client tries to access an unauthorized resource, the server will return a status code of 401. Similarly, if the client tries to access a forbidden resource, in which case the client's authentication status is the same, the server may return a status code 403, indicating that access to the resource is forbidden. If the request is incorrect or the client times out, a 400-level error code may also be returned. However, there is a 400-level code that is always misleading: 404. Although this code is technically classified as a client-side error, in fact it can represent an error on both the client and the server. But this error code simply shows that the requested resource was not found. When this error occurs on the client, it often indicates a network connection problem. At other times, this error may also occur because the resource has been transferred or renamed from the server.

Server Error
The 500-level status code indicates a server error.

For example, if the web server times out, it will generate a 504 error. Although, a 500-level error often means not a problem with the server, but a problem with the web application running on the server. For example, my own personal website is written in ASP, which is responsible for dynamically generating HTML pages. In the process of debugging, the code with bug will always cause my web server to return HTTP status code 500, which generally indicates an internal server error. This code just has a problem, and HTTP cannot solve the problem.


The specific meaning of common HTTP error codes on the Internet

100 (Continue) The requester should continue to make the request. The server returns this code to indicate that it has received the first part of the request and is waiting for the rest.

101 (Switching protocol) The requester has asked the server to switch the protocol, and the server has confirmed and is ready to switch.

200 (Success) The server has successfully processed the request. Usually, this means that the server provided the requested page.

201 (Created) The request was successful and the server created a new resource.

202 (Accepted) The server has accepted the request, but has not yet processed it.

203 (Non-authorized information) The server has successfully processed the request, but the returned information may come from another source.

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

205 (Reset content) The server successfully processed the request, but did not return any content.

206 (Partial content) The server successfully processed part of the GET request.

300 (multiple choices) In response to requests, the server can perform multiple operations. The server can select an operation based on the requester (user agent), or provide a list of operations for the requester to choose.

301 (Moved Permanently) The requested page has been permanently moved to a new location. When the server returns this response (a response to a GET or HEAD request), it will automatically redirect the requester to the new location.

302 (Temporary move) The server currently responds to requests from web pages in different locations, but the requester should continue to use the original location for future requests.

303 (View other locations) The server returns this code when the requester should use separate GET requests for different locations to retrieve the response.

304 (Unmodified) The requested page has not been modified since the last request. When the server returns this response, the content of the web page will not be returned.

305 (Use proxy) The requester can only use the proxy to access the requested web page. If the server returns this response, it also indicates that the requester should use a proxy.

307 (Temporary redirect) The server currently responds to requests from web pages in different locations, but the requester should continue to use the original location for future requests.

400 (Bad request) The server does not understand the syntax of the request.

401 (Unauthorized) The request requires authentication. For web pages that require login, the server may return this response.

403 (Forbidden) The server rejected the request.

404 (Not Found) The server could not find the requested page.

405 (Method Disable) Disable the method specified in the request.

406 (Not Accepted) Unable to respond to the requested page with the requested content characteristics.

407 (Proxy authorization required) This status code is similar to 401 (Unauthorized), but specifies that the requester should be authorized to use the proxy.

408 (Request timeout) The server timed out while waiting for the request.

409 (Conflict) The server encountered a conflict while fulfilling the request. The server must include information about the conflict in the response.

410 (Deleted) If the requested resource has been permanently deleted, the server will return this response.

411 (Valid length required) The server does not accept requests without a valid content length header field.

412 (Precondition not met) The server did not meet one of the preconditions set by the requester in the request.

413 (The request entity is too large) The server cannot process the request because the request entity is too large and exceeds the server's processing capacity.

414 (The requested URI is too long) The requested URI (usually a URL) is too long for the server to process.

415 (Unsupported media type) The requested format is not supported by the requested page.

416 (The requested range does not meet the requirements) If the page cannot provide the requested range, the server will return this status code.

417 (Expected value not met) The server did not meet the requirements of the "expected" request header field.

500 (Internal server error) The server encountered an error and could not complete the request.

501 (Not yet implemented) The server does not have the function to complete the request. For example, the server may return this code when the request method is not recognized.

502 (Bad gateway) The server was acting as a gateway or proxy and received an invalid response from the upstream server.

503 (Service unavailable) The server is currently unavailable (due to overload or maintenance shutdown). Usually, this is only a temporary state.

504 (Gateway timeout) The server is acting as a gateway or proxy, but did not receive a request from the upstream server in time.

505 (HTTP version is not supported) The server does not support the HTTP protocol version used in the request.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.