/** * HTTP 状态码常量 */ const HTTP_STATUS = { // 信息响应 (100–199) /** @type {number} 继续 */ CONTINUE: 100, /** @type {number} 协议切换 */ SWITCHING_PROTOCOLS: 101, // 成功响应 (200–299) /** @type {number} 请求成功 */ OK: 200, /** @type {number} 请求成功并且服务器创建了新的资源 */ CREATED: 201, /** @type {number} 已接受 */ ACCEPTED: 202, /** @type {number} 没有内容 */ NO_CONTENT: 204, // 重定向消息 (300–399) /** @type {number} 永久移动 */ MOVED_PERMANENTLY: 301, /** @type {number} 找到 */ FOUND: 302, /** @type {number} 查看其他位置 */ SEE_OTHER: 303, /** @type {number} 临时重定向 */ TEMPORARY_REDIRECT: 307, // 客户端错误响应 (400–499) /** @type {number} 错误请求 */ BAD_REQUEST: 400, /** @type {number} 未授权 */ UNAUTHORIZED: 401, /** @type {number} 禁止 */ FORBIDDEN: 403, /** @type {number} 未找到 */ NOT_FOUND: 404, /** @type {number} 方法禁用 */ METHOD_NOT_ALLOWED: 405, /** @type {number} 不接受 */ NOT_ACCEPTABLE: 406, /** @type {number} 请求超时 */ REQUEST_TIMEOUT: 408, /** @type {number} 冲突 */ CONFLICT: 409, /** @type {number} 已删除 */ GONE: 410, /** @type {number} 负载过大 */ PAYLOAD_TOO_LARGE: 413, /** @type {number} URI 过长 */ URI_TOO_LONG: 414, /** @type {number} 不支持的媒体类型 */ UNSUPPORTED_MEDIA_TYPE: 415, // 服务器错误响应 (500–599) /** @type {number} 服务器错误 */ INTERNAL_SERVER_ERROR: 500, /** @type {number} 未实施 */ NOT_IMPLEMENTED: 501, /** @type {number} 错误网关 */ BAD_GATEWAY: 502, /** @type {number} 服务不可用 */ SERVICE_UNAVAILABLE: 503, /** @type {number} 网关超时 */ GATEWAY_TIMEOUT: 504 } module.exports = HTTP_STATUS