Skip to content

Commit db2a07c

Browse files
committed
doc file updated
1 parent 29cf3fa commit db2a07c

File tree

2 files changed

+140
-85
lines changed

2 files changed

+140
-85
lines changed

docs/status-codes-doc.md

Lines changed: 0 additions & 85 deletions
This file was deleted.
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
# HTTP Status Codes Documentation
2+
3+
This document includes all the supported HTTP status codes provided by `http-status-toolkit`. Each entry shows:
4+
5+
- The numerical code
6+
- Its constant name (TypeScript-safe)
7+
- A short message
8+
9+
---
10+
11+
## ✅ Official HTTP Status Codes
12+
13+
| Code | Constant | Message |
14+
|------|----------------------------------|----------------------------------|
15+
| 100 | CONTINUE | Continue |
16+
| 101 | SWITCHING_PROTOCOLS | Switching Protocols |
17+
| 102 | PROCESSING | Processing |
18+
| 103 | EARLY_HINTS | Early Hints |
19+
| 200 | OK | OK |
20+
| 201 | CREATED | Created |
21+
| 202 | ACCEPTED | Accepted |
22+
| 203 | NON_AUTHORITATIVE_INFORMATION | Non-Authoritative Information |
23+
| 204 | NO_CONTENT | No Content |
24+
| 205 | RESET_CONTENT | Reset Content |
25+
| 206 | PARTIAL_CONTENT | Partial Content |
26+
| 207 | MULTI_STATUS | Multi Status |
27+
| 208 | ALREADY_REPORTED | Already Reported |
28+
| 226 | IM_USED | IM Used |
29+
| 300 | MULTIPLE_CHOICES | Multiple Choices |
30+
| 301 | MOVED_PERMANENTLY | Moved Permanently |
31+
| 302 | FOUND | Found |
32+
| 303 | SEE_OTHER | See Other |
33+
| 304 | NOT_MODIFIED | Not Modified |
34+
| 305 | USE_PROXY | Use Proxy |
35+
| 307 | TEMPORARY_REDIRECT | Temporary Redirect |
36+
| 308 | PERMANENT_REDIRECT | Permanent Redirect |
37+
| 400 | BAD_REQUEST | Bad Request |
38+
| 401 | UNAUTHORIZED | Unauthorized |
39+
| 402 | PAYMENT_REQUIRED | Payment Required |
40+
| 403 | FORBIDDEN | Forbidden |
41+
| 404 | NOT_FOUND | Not Found |
42+
| 405 | METHOD_NOT_ALLOWED | Method Not Allowed |
43+
| 406 | NOT_ACCEPTABLE | Not Acceptable |
44+
| 407 | PROXY_AUTHENTICATION_REQUIRED | Proxy Authentication Required |
45+
| 408 | REQUEST_TIMEOUT | Request Timeout |
46+
| 409 | CONFLICT | Conflict |
47+
| 410 | GONE | Gone |
48+
| 411 | LENGTH_REQUIRED | Length Required |
49+
| 412 | PRECONDITION_FAILED | Precondition Failed |
50+
| 413 | PAYLOAD_TOO_LARGE | Payload Too Large |
51+
| 414 | URI_TOO_LONG | URI Too Long |
52+
| 415 | UNSUPPORTED_MEDIA_TYPE | Unsupported Media Type |
53+
| 416 | RANGE_NOT_SATISFIABLE | Range Not Satisfiable |
54+
| 417 | EXPECTATION_FAILED | Expectation Failed |
55+
| 418 | IM_A_TEAPOT | I'm a teapot |
56+
| 421 | MISDIRECTED_REQUEST | Misdirected Request |
57+
| 422 | UNPROCESSABLE_ENTITY | Unprocessable Entity |
58+
| 423 | LOCKED | Locked |
59+
| 424 | FAILED_DEPENDENCY | Failed Dependency |
60+
| 426 | UPGRADE_REQUIRED | Upgrade Required |
61+
| 428 | PRECONDITION_REQUIRED | Precondition Required |
62+
| 429 | TOO_MANY_REQUESTS | Too Many Requests |
63+
| 431 | REQUEST_HEADER_FIELDS_TOO_LARGE | Request Header Fields Too Large |
64+
| 451 | UNAVAILABLE_FOR_LEGAL_REASONS | Unavailable For Legal Reasons |
65+
| 500 | INTERNAL_SERVER_ERROR | Internal Server Error |
66+
| 501 | NOT_IMPLEMENTED | Not Implemented |
67+
| 502 | BAD_GATEWAY | Bad Gateway |
68+
| 503 | SERVICE_UNAVAILABLE | Service Unavailable |
69+
| 504 | GATEWAY_TIMEOUT | Gateway Timeout |
70+
| 505 | HTTP_VERSION_NOT_SUPPORTED | HTTP Version Not Supported |
71+
| 506 | VARIANT_ALSO_NEGOTIATES | Variant Also Negotiates |
72+
| 507 | INSUFFICIENT_STORAGE | Insufficient Storage |
73+
| 508 | LOOP_DETECTED | Loop Detected |
74+
| 510 | NOT_EXTENDED | Not Extended |
75+
| 511 | NETWORK_AUTHENTICATION_REQUIRED | Network Authentication Required |
76+
77+
---
78+
79+
## 🟡 Unofficial Status Codes
80+
81+
| Code | Constant | Message |
82+
|------|-----------------------------------|------------------------------------------|
83+
| 419 | PAGE_EXPIRED | Page Expired |
84+
| 420 | METHOD_FAILURE | Method Failure |
85+
| 420 | ENHANCE_YOUR_CALM | Enhance Your Calm |
86+
| 450 | BLOCKED_BY_WINDOWS_PARENTAL_CONTROLS | Blocked by Parental Controls |
87+
| 498 | INVALID_TOKEN | Invalid Token |
88+
| 499 | TOKEN_REQUIRED | Token Required |
89+
| 509 | BANDWIDTH_LIMIT_EXCEEDED | Bandwidth Limit Exceeded |
90+
| 530 | SITE_IS_FROZEN | Site is Frozen |
91+
| 598 | NETWORK_READ_TIMEOUT_ERROR | Network Read Timeout Error |
92+
| 599 | NETWORK_CONNECT_TIMEOUT_ERROR | Network Connect Timeout Error |
93+
94+
---
95+
96+
## 🪟 Microsoft IIS Codes
97+
98+
| Code | Constant | Message |
99+
|------|-------------------|--------------------|
100+
| 440 | LOGIN_TIMEOUT | Login Timeout |
101+
| 449 | RETRY_WITH | Retry With |
102+
| 451 | REDIRECT | Redirect |
103+
104+
---
105+
106+
## 🧩 NGINX Specific Codes
107+
108+
| Code | Constant | Message |
109+
|------|-----------------------------------|----------------------------------------|
110+
| 444 | NO_RESPONSE | No Response |
111+
| 494 | REQUEST_HEADER_TOO_LARGE | Request Header Too Large |
112+
| 495 | SSL_CERTIFICATE_ERROR | SSL Certificate Error |
113+
| 496 | SSL_CERTIFICATE_REQUIRED | SSL Certificate Required |
114+
| 497 | HTTP_REQUEST_SENT_TO_HTTPS_PORT | HTTP Request Sent to HTTPS Port |
115+
| 499 | CLIENT_CLOSED_REQUEST | Client Closed Request |
116+
117+
---
118+
119+
## ☁️ Cloudflare Specific Codes
120+
121+
| Code | Constant | Message |
122+
|------|-------------------------------|----------------------------------|
123+
| 520 | UNKNOWN_ERROR | Unknown Error |
124+
| 521 | WEB_SERVER_IS_DOWN | Web Server Is Down |
125+
| 522 | CONNECTION_TIMED_OUT | Connection Timed Out |
126+
| 523 | ORIGIN_IS_UNREACHABLE | Origin Is Unreachable |
127+
| 524 | A_TIMEOUT_OCCURRED | A Timeout Occurred |
128+
| 525 | SSL_HANDSHAKE_FAILED | SSL Handshake Failed |
129+
| 526 | INVALID_SSL_CERTIFICATE | Invalid SSL Certificate |
130+
| 527 | RAILGUN_ERROR | Railgun Error |
131+
132+
---
133+
134+
## 📦 Tip
135+
136+
To get messages programmatically:
137+
138+
```ts
139+
getStatusMessage(StatusCodes.NOT_FOUND); // "Not Found"
140+
getStatusMessage(StatusCodes.NOT_FOUND, true); // Detailed message

0 commit comments

Comments
 (0)