@alexsasharegan/http-status
Version:
HTTP Status codes as constants and a lookup map (ESM)
124 lines (122 loc) • 4.8 kB
JavaScript
export const CONTINUE = 100
export const SWITCHING_PROTOCOLS = 101
export const OK = 200
export const CREATED = 201
export const ACCEPTED = 202
export const NON_AUTHORITATIVE_INFORMATION = 203
export const NO_CONTENT = 204
export const RESET_CONTENT = 205
export const PARTIAL_CONTENT = 206
export const MULTI_STATUS = 207
export const ALREADY_REPORTED = 208
export const IM_USED = 226
export const MULTIPLE_CHOICES = 300
export const MOVED_PERMANENTLY = 301
export const FOUND = 302
export const SEE_OTHER = 303
export const NOT_MODIFIED = 304
export const USE_PROXY = 305
export const SWITCH_PROXY = 306
export const TEMPORARY_REDIRECT = 307
export const PERMANENT_REDIRECT = 308
export const BAD_REQUEST = 400
export const UNAUTHORIZED = 401
export const PAYMENT_REQUIRED = 402
export const FORBIDDEN = 403
export const NOT_FOUND = 404
export const METHOD_NOT_ALLOWED = 405
export const NOT_ACCEPTABLE = 406
export const PROXY_AUTHENTICATION_REQUIRED = 407
export const REQUEST_TIMEOUT = 408
export const CONFLICT = 409
export const GONE = 410
export const LENGTH_REQUIRED = 411
export const PRECONDITION_FAILED = 412
export const REQUEST_ENTITY_TOO_LARGE = 413
export const REQUEST_URI_TOO_LONG = 414
export const UNSUPPORTED_MEDIA_TYPE = 415
export const REQUESTED_RANGE_NOT_SATISFIABLE = 416
export const EXPECTATION_FAILED = 417
export const IM_A_TEAPOT = 418
export const MISDIRECTED_REQUEST = 421
export const UNPROCESSABLE_ENTITY = 422
export const UPGRADE_REQUIRED = 426
export const PRECONDITION_REQUIRED = 428
export const LOCKED = 423
export const FAILED_DEPENDENCY = 424
export const TOO_MANY_REQUESTS = 429
export const REQUEST_HEADER_FIELDS_TOO_LARGE = 431
export const UNAVAILABLE_FOR_LEGAL_REASONS = 451
export const INTERNAL_SERVER_ERROR = 500
export const NOT_IMPLEMENTED = 501
export const BAD_GATEWAY = 502
export const SERVICE_UNAVAILABLE = 503
export const GATEWAY_TIMEOUT = 504
export const HTTP_VERSION_NOT_SUPPORTED = 505
export const VARIANT_ALSO_NEGOTIATES = 506
export const INSUFFICIENT_STORAGE = 507
export const LOOP_DETECTED = 508
export const NOT_EXTENDED = 510
export const NETWORK_AUTHENTICATION_REQUIRED = 511
export const STATUS_MAP = {
[]: 'Continue',
[]: 'Switching Protocols',
[]: 'OK',
[]: 'Created',
[]: 'Accepted',
[]: 'Non-Authoritative Information',
[]: 'No Content',
[]: 'Reset Content',
[]: 'Partial Content',
[]: 'Multi Status',
[]: 'Already Reported',
[]: 'IM Used',
[]: 'Multiple Choices',
[]: 'Moved Permanently',
[]: 'Found',
[]: 'See Other',
[]: 'Not Modified',
[]: 'Use Proxy',
[]: 'Switch Proxy',
[]: 'Temporary Redirect',
[]: 'Permanent Redirect',
[]: 'Bad Request',
[]: 'Unauthorized',
[]: 'Payment Required',
[]: 'Forbidden',
[]: 'Not Found',
[]: 'Method Not Allowed',
[]: 'Not Acceptable',
[]: 'Proxy Authentication Required',
[]: 'Request Time-out',
[]: 'Conflict',
[]: 'Gone',
[]: 'Length Required',
[]: 'Precondition Failed',
[]: 'Request Entity Too Large',
[]: 'Request-URI Too Large',
[]: 'Unsupported Media Type',
[]: 'Requested Range not Satisfiable',
[]: 'Expectation Failed',
[]: 'I\'m a teapot',
[]: 'Misdirected Request',
[]: 'Unprocessable Entity',
[]: 'Locked',
[]: 'Failed Dependency',
[]: 'Upgrade Required',
[]: 'Precondition Required',
[]: 'Too Many Requests',
[]: 'Request Header Fields Too Large',
[]: 'Unavailable For Legal Reasons',
[]: 'Internal Server Error',
[]: 'Not Implemented',
[]: 'Bad Gateway',
[]: 'Service Unavailable',
[]: 'Gateway Time-out',
[]: 'HTTP Version not Supported',
[]: 'Variant Also Negotiates',
[]: 'Insufficient Storage',
[]: 'Loop Detected',
[]: 'Not Extended',
[]: 'Network Authentication Required',
}