http错误代码

状态码为4**和5**的都是错误,以下从http协议中摘录,全部信息请参考后边的链接。

Error 4xx, 5xx 
The 4xx codes are intended for cases in which the client seems to have erred, and the 5xx codes for the cases in which the server is aware that the server has erred. It is impossible to distinguish these cases in general, so the difference is only informational. 

The body section may contain a document describing the error in human readable form. The document is in MIME format, and may only be in text/plain, text/html or one for the formats specified as acceptable in the request. 

Bad request 400 
The request had bad syntax or was inherently impossible to be satisfied. 

Unauthorized 401 
The parameter to this message gives a specification of authorization schemes which are acceptable. The client should retry the request with a suitable Authorization header. 

PaymentRequired 402 
The parameter to this message gives a specification of charging schemes acceptable. The client may retry the request with a suitable ChargeTo header. 

Forbidden 403 
The request is for something forbidden. Authorization will not help. 

Not found 404 
The server has not found anything matching the URI given 

Internal Error 500 
The server encountered an unexpected condition which prevented it from fulfilling the request. 

Not implemented 501 
The server does not support the facility required. 

Service temporarily overloaded 502 (TO BE DISCUSSED) 
The server cannot process the request due to a high load (whether HTTP servicing or other requests). The implication is that this is a temporary condition which maybe alleviated at other times. 

Gateway timeout 503 (TO BE DISCUSSED) 
This is equivalent to Internal Error 500, but in the case of a server which is in turn accessing some other service, this indicates that the respose from the other service did not return within a time that the gateway was prepared to wait. As from the point of view of the clientand the HTTP transaction the other service is hidden within the server, this maybe treated identically to Internal error 500, but has more diagnostic value.
原文地址:https://www.cnblogs.com/kelin1314/p/1966329.html