SWITCH_PROTOCOL(101, "Switching Protocols"),
OK(200, "OK"),
CREATED(201, "Created"),
ACCEPTED(202, "Accepted"),
NO_CONTENT(204, "No Content"),
PARTIAL_CONTENT(206, "Partial Content"),
MULTI_STATUS(207, "Multi-Status"),
REDIRECT(301, "Moved Permanently"),
/**
* Many user agents mishandle 302 in ways that violate the RFC1945
* spec (i.e., redirect a POST to a GET). 303 and 307 were added in
* RFC2616 to address this. You should prefer 303 and 307 unless the
* calling user agent does not support 303 and 307 functionality
*/
@Deprecated
FOUND(302, "Found"),
REDIRECT_SEE_OTHER(303, "See Other"),
NOT_MODIFIED(304, "Not Modified"),
TEMPORARY_REDIRECT(307, "Temporary Redirect"),
BAD_REQUEST(400, "Bad Request"),
UNAUTHORIZED(401, "Unauthorized"),
FORBIDDEN(403, "Forbidden"),
NOT_FOUND(404, "Not Found"),
METHOD_NOT_ALLOWED(405, "Method Not Allowed"),
NOT_ACCEPTABLE(406, "Not Acceptable"),
REQUEST_TIMEOUT(408, "Request Timeout"),
CONFLICT(409, "Conflict"),
GONE(410, "Gone"),
LENGTH_REQUIRED(411, "Length Required"),
PRECONDITION_FAILED(412, "Precondition Failed"),
PAYLOAD_TOO_LARGE(413, "Payload Too Large"),
UNSUPPORTED_MEDIA_TYPE(415, "Unsupported Media Type"),
RANGE_NOT_SATISFIABLE(416, "Requested Range Not Satisfiable"),
EXPECTATION_FAILED(417, "Expectation Failed"),
TOO_MANY_REQUESTS(429, "Too Many Requests"),
INTERNAL_ERROR(500, "Internal Server Error"),
NOT_IMPLEMENTED(501, "Not Implemented"),
SERVICE_UNAVAILABLE(503, "Service Unavailable"),
UNSUPPORTED_HTTP_VERSION(505, "HTTP Version Not Supported");
500:服务器内部出现错误
501:服务器无法识别请求方法
503:(服务不可用) 服务器目前无法使用(由于超载或停机维护)。通常,这只是暂时状态。
505: (HTTP 版本不受支持) 服务器不支持请求中所用的 HTTP 协议版本。
400: 服务器不懂客户端的请求
401:请求要求用户的身份认证(客户端:我要一瓶可乐,并打85折,服务器:有会员卡?有就打折)
403:服务器理解客户端的请求,但是拒绝执行此请求(客户端:把你的钱都给我,服务器:对不起,拒绝服务)
404:服务器无法根据客户端的请求找到资源(网页)(客户端:请给我一瓶香飘飘奶茶,服务器:我们这里没有优乐美奶茶)
405:客户端请求的方法被禁止。(客户端:我用微信支付,服务端:对不起,我们不支持手机支付,只能现金)
502:作为网关或者代理工作的服务器尝试执行请求时,从上游服务器接收到无效的响应。
504:作为网关或者代理工作的服务器尝试执行请求时,未能及时从上游服务器(URI标识出的服务器,例如HTTP、FTP、LDAP)或者辅助服务器(例如DNS)收到响应。