HTTP状态码(HTTP Status Code)是用以表示网页服务器HTTP响应状态的3位数字代码。它由 RFC2616 规范定义的 ,并得到RFC 2518、RFC 2817、RFC 2295、RFC 2774、RFC 4918等规范扩展。
//Informational 1xx 信息
'100' : 'Continue', //继续
'101' : 'Switching Protocols', //交换协议
//Successful 2xx 成功
'200' : 'OK', //请求成功
'201' : 'Created', //创建
'202' : 'Accepted', //已接受
'203' : 'Non-Authoritative Information', //非权威信息
'204' : 'No Content', //没有内容
'205' : 'Reset Content', //重置内容
'206' : 'Partial Content', //部分内容
//Redirection 3xx 重定向
'300' : 'Multiple Choices', //请求的信息有多种表示形式,默认操作是将此状态视为重定向
'301' : 'Moved Permanently', //永久移动,资源已被分配了新的URL
'302' : 'Found', //临时转移,资源临时分配了新的URL
'303' : 'See Other', //临时转移,资源存在另一个URL,用get方法获取资源
'304' : 'Not Modified', //未修改,客户端可以直接从浏览器缓存里获取该资源
'305' : 'Use Proxy', //使用代理
'306' : 'Unused', //未使用
'307' : 'Temporary Redirect', //暂时重定向
//Client Error 4xx 客户端错误
'400' : 'Bad Request', //错误的请求
'401' : 'Unauthorized', //未经授权
'402' : 'Payment Required', //该状态码是为了将来可能的需求而预留的
'403' : 'Forbidden', //禁止,服务器拒绝请求
'404' : 'Not Found', //没有找到请求的资源
'405' : 'Method Not Allowed', //方法不允许
'406' : 'Not Acceptable', //不可接受
'407' : 'Proxy Authentication Required', //需要代理身份验证
'408' : 'Request Timeout', //请求超时
'409' : 'Conflict', //指令冲突
'410' : 'Gone', //文档永久地离开了指定的位置
'411' : 'Length Required', //需要Content-Length头请求
'412' : 'Precondition Failed', //前提条件失败
'413' : 'Request Entity Too Large', //请求实体太大
'414' : 'Request-URI Too Long', //请求URI太长
'415' : 'Unsupported Media Type', //不支持的媒体类型
'416' : 'Requested Range Not Satisfiable', //请求的范围不可满足
'417' : 'Expectation Failed', //期望失败
//Server Error 5xx 服务器错误
'500' : 'Internal Server Error', // 服务器遇到错误,无法完成请求
'501' : 'Not Implemented', //服务器不支持请求
'502' : 'Bad Gateway', //错误的网关
'503' : 'Service Unavailable', //服务不可用,由于超载或停机维护
'504' : 'Gateway Timeout', //网关超时
'505' : 'HTTP Version Not Supported' //HTTP版本不支持