[Protocol] 4. http status code and http status code
10.4 customer error 4xx
The status code 4xx class is specifically used when the customer looks wrong. unless, when a HEAD request is answered, the server has an entity that includes an explanation of the error and whether the server has a temporary or terminated condition. these status codes can be applied to any request method. the user agent should display any included entities to the user.
If the customer is sending data, the TCP server implementation should be careful to ensure that the Customer acknowledges receipt of the packet containing the response when the server closes all input connections. if the client continues to send data to the server after it is switched off, the TCP heap of the server will send a conversion packet. This may occur when the server is accessed and the HTTP application is interpreted, the input buffer that the customer does not know is erased.
10.4.1 400 bad requests
Requests are not understood by the server due to malformed syntax. Customers should not repeat their own requests without changing.
10.4.2 401 unauthorized
The request requires user authentication. the response must contain the WWW Authentication Header area for challenges to the requested resource. if there is an appropriate Authentication Header area, the customer can repeat the request. if the request already contains the authentication trust book, The 401 response indicates that the authentication is rejected due to these trust books. if the 401 response includes the same challenges as the previous response and the user agent has tried to authenticate at least once, the entity should be given to the user in the response, because the entity may contain the corresponding diagnostic information. HTTP Access Authentication is explained in "HTTP Authentication: Basicand Digest Access Authentication.
10.4.3 402 payment required
This code is saved for future use.
10.4.4 403 disabled
The server understands the request but rejects the request. authentication will not help, and requests should not be repeated. if the request method is not a HEAD and the server is willing to tell you why the request is not implemented, it should describe the reason for rejection in the entity. if the server does not want to tell the customer this information, Status Code 404 (not found) can be used in place.
Not found in 10.4.5 404
The server does not find any matching request URI. the condition is permanent or temporary, and there are no signs. 410 status code should be used only when the server knows that the old resources are never available and there is no previous address. this status code is widely used when the server does not want to precisely display why a request is rejected or when no other response is available.
10.4.6 405 disallow Methods
The method specified in the request line does not allow access to resources specified by the request URI. The response must have an allowed header that includes some methods that are valid for the requested resource.
10.4.7 406 not accepted
The resource specified by the request may only generate a response entity that has an unacceptable content attribute in the accept header in the sent request.
Unless it is a HEAD request, the response should include a series of optional entity features and locations, from which users and user agents can find the most suitable. the entity format is specified by the media format given in the header area of the same form. depending on this format and the performance of the user agent, the best choice may be automatically completed. however, this specification does not define any criteria for this automatic selection
Note: The HTTP/1.1 server allows responses that are not accepted according to the accept header sent in the request. in some cases, sending a 406 response is even more advantageous. the user agent is encouraged to check the header of the input response to determine whether it is acceptable.
If the response is not accepted, the user agent should temporarily stop receiving more data and query the user for further action decisions.
10.4.8 407 required for Proxy Server Authentication
This code is similar to 401, but it indicates that the customer must authenticate himself with the proxy server. the proxy server must return a proxy server-the Authentication Header area, which includes challenges used by the proxy server for the requested resources. the customer may repeat its request along with an appropriate Proxy Server Authentication Header area. HTTP access Authentication is explained in "HTTP Authentication: Basic and Digest AccessAuthentication.
10.4.9 408 request timeout
During the waiting period, the customer does not produce a request. The customer may repeat the request at any time in the future.
10.4.10 409 conflict
Because of the conflict with the current status of the resource, the visitor can complete the request. the code can be used only when the user is expected to resolve conflicts and submit requests. the response body should include enough information about the user's sources of conflict. ideally, the response body should have enough information for users and user agents to solve the problem. however, this may be impossible or unnecessary.
A conflict usually occurs when a PUT request is answered. for example, if the version being used and the PUT entity has changes to resources that conflict with the previous request (third-party), the server will use the 409 response to indicate that the request cannot be completed. in this case, the response entity may include a series of differences between the two versions defined in the content form response.
10.4.11 410 stop
The requested resources on the server are no longer available and do not know the previous address. we expect this condition to be permanent. with the user's consent, the client with the connection editing capability should delete the reference for the request URI. if the server does not know, or there is no device to determine whether the condition is permanent, Status Code 404 (not found) should be used at this time. such a response cannot be cached unless otherwise specified.
410 the response mainly aims to notify the requestor of the resource's intended unavailability and the server owner's desire to remove these two information for the connections to the resources remotely for WEB maintenance. this usually happens when the time is limited. The added services and resources that no longer work on the server are private resources. we don't need to mark all the permanently unavailable resources "no" or any length of time on them-let the owners of those servers determine it by themselves.
10.4.12 411 required length
The server rejects requests with unspecified content lengths. If a valid Content Length header area "containing the length in the body of the Request Message" is added, the customer may repeat the request.
10.4.13 412 preprocessing failed
Preprocessing given in one or more requests will be evaluated as incorrect when being verified by the server. this response code allows the customer to put preprocessing in the current resource maintenance information (header area data), and so on to prevent other methods that adapt to resource requests rather than the desired one.
10.4.14 413 the Request Entity is too large
The server rejects a request because the request is larger than what the server can handle. The server may close the connection to prevent the customer from continuing the request.
If the condition is temporary, the server should have a retry-in the subsequent header area to indicate the temporary time after which the customer can try again.
10.4.15 414 the request URI is too long
The server rejects the request because the requested URI is longer than what the server is willing to explain. this rare condition may occur when Party classes complement each other and appropriately change the POST request to a GET request with long query information, or when the customer falls into a reoriented URI black hole, in addition, when a server that uses a fixed-length buffer to read or process the request URI is attacked by hackers who exploit the vulnerability.
10.4.16 415 unsupported media type
The server rejects the request because the requested entity requests the service in a format not supported by the requested resource.
10.4.17 416 request range not met
If a request includes a range Request Header area, or the value of a range descriptor in the region overflows the extension of the selected resource, or the request does not contain a range request-header area, the server should return a response along with the status code. (For the byte-range, it means the first byte in the description of all byte ranges ??? The value is larger than the length of the selected resource)
When the status code returns a byte range request, the response should contain a content range area detailing the length of the selected resource. (See 14.16 ). multi-part/byte format is prohibited for response.
10.4.18 417 expected failure
What is provided in the Request Header area is not expected to be implemented by the server. or, if the server is a proxy server, a request from the server cannot be implemented by the next ?? Fuzzy evidence of server implementation
10.5 server error 5xx
The response status code uses the Arabic number "5" to indicate that the server knows that it has an error or cannot implement the request itself. in addition to responding to a HEAD request, the server should have an entity that contains an interpretation of the incorrect form and whether it is a temporary or permanent condition. the user agent should display any included entities to the user. these response codes are applicable to any request method.
10.5.1 500 Internal Server Error
The server encounters unexpected circumstances to prevent it from completing the request.
10.5.2 501 cannot be implemented
The server does not support the functionality required to complete the request. This is an appropriate response when the server does not recognize the request method and is not capable of supporting any resources.
10.5.3 502 Bad Gateway
Server, when used as a gateway or proxy server, it will receive an invalid response from the upper-class server to try to complete the request access.
10.5.4 503 inaccessible services.
The server cannot handle requests due to temporary overload or server maintenance. this indicates that this is a temporary condition, and some delays will be mitigated. if you know, the length of the delay should be retried-indicated in the subsequent header. if you do not try again-the customer should handle the response later, just like handling a 500 response.
Note: The existence of status code 503 does not imply that the server must use it when it becomes overloaded. Some servers simply refuse to connect.
10.5.5 504 gateway timeout
Server. When used as a gateway or proxy server, because the upstream server specified by URI or some other secondary servers are eligible to complete the request, no timely response is received.
Note: Device annotation: Some expanded proxy servers know that 400 or 500 is returned when the DNS query time is too long.
10.5.6 505 HTTP Version Not Supported
The HTTP Protocol version is used in the request information. the server points out that it cannot or is unwilling to complete a request using the same version as the client, as described in Chapter 3.1 ,???????. The response should contain entities that describe why that version is not supported and why other protocols are supported by the server ..