HTTP Status Codes Reference
| Code | Name | अर्थ |
|---|---|---|
| 100 | जारी रखें | Client को request body के साथ जारी रखना चाहिए |
| 101 | Switching Protocols | Protocol upgrade स्वीकार किया गया (जैसे WebSocket पर) |
| 200 | OK | Request सफल हुई — default success response |
| 201 | बनाया गया | एक नया resource बनाया गया (आम POST सफलता) |
| 202 | स्वीकृत | Async processing के लिए queued, अभी पूरा नहीं |
| 204 | No Content | जानबूझकर खाली body के साथ success |
| 301 | Moved Permanently | Resource का एक नया permanent URL है — links update करें; SEO equity transfer होती है |
| 302 | मिला | Temporary redirect (ऐतिहासिक रूप से misused; 303/307 देखें) |
| 303 | See Other | दूसरे URL पर GET पर redirect (post/redirect/get) |
| 304 | Not Modified | Cached copy अब भी valid है — ETag/Last-Modified के ज़रिए revalidate करें |
| 307 | Temporary Redirect | Method और body सुरक्षित रखने वाला temporary redirect |
| 308 | Permanent Redirect | Method और body सुरक्षित रखने वाला permanent redirect |
| 400 | Bad Request | Server request को parse/समझ नहीं सकता |
| 401 | Unauthorized | Authentication आवश्यक है या विफल हुआ (नाम के बावजूद, इसका मतलब है unauthenticated) |
| 403 | Forbidden | Authenticated हो या न हो, पहुँच अस्वीकृत है |
| 404 | Not Found | इस URL पर कोई resource नहीं |
| 405 | Method Not Allowed | इस resource के लिए HTTP method supported नहीं है |
| 406 | Not Acceptable | कोई representation Accept headers से match नहीं करती |
| 408 | Request Timeout | Client ने request भेजने में बहुत देर ली |
| 409 | Conflict | State conflict, जैसे edit collision या duplicate creation |
| 410 | Gone | स्थायी रूप से हटाया गया (404 से मज़बूत — जानबूझकर उपयोग होता है) |
| 411 | Length Required | Content-Length header ज़रूरी है |
| 413 | Content बहुत बड़ा है | Request body server limits से ज़्यादा है |
| 414 | URI Too Long | URL server limits से ज़्यादा है |
| 415 | Unsupported Media Type | Request Content-Type supported नहीं है |
| 418 | I'm a Teapot | RFC 2324 joke code, कभी-कभी coffee बनाने से इनकार करने के लिए उपयोग होता है |
| 422 | Unprocessable Content | Syntax ठीक है लेकिन semantics validation में fail होते हैं (APIs को यह पसंद है) |
| 425 | Too Early | Server संभवतः replayed request को process करने के लिए तैयार नहीं |
| 429 | Too Many Requests | Rate limit hit — पीछे हटें, Retry-After का सम्मान करें |
| 500 | Internal Server Error | Generic server-side विफलता |
| 501 | Not Implemented | Server functionality को support नहीं करता |
| 502 | Bad Gateway | Proxy/gateway को upstream से invalid response मिला |
| 503 | Service Unavailable | Overloaded या maintenance के लिए down — अक्सर अस्थायी, Retry-After रख सकता है |
| 504 | Gateway Timeout | Proxy/gateway upstream का इंतज़ार करते हुए timed out हो गया |
| 505 | HTTP Version Not Supported | Request में HTTP version supported नहीं है |
हमारे बारे में
Status codes हर response का server का one-number summary हैं, class के अनुसार grouped: 1xx informational, 2xx success, 3xx redirection, 4xx client ने ग़लती की, 5xx server ने ग़लती की। Table वे codes देती है जिनसे working developers सच में मिलते हैं, उन nuances के साथ जो practice में मायने रखती हैं — 401 का अर्थ इसके नाम के बावजूद unauthenticated है, 403 login के बावजूद एक इनकार है, 422 API validation failure है, 429 backoff माँगता है। Listed नहीं किए गए codes (1xx और experimental codes की लंबी tail) इतने rare हैं कि सिर्फ़ class आपको बताती है कि उन्हें कैसे handle करें।
अक्सर पूछे जाने वाले सवाल
401 और 403 के बीच क्या अंतर है?
401: हमें नहीं पता कि आप कौन हैं (authenticate करें)। 403: हम जानते हैं, और फिर भी आपको अनुमति नहीं है।
अस्थायी redirect के लिए 302 या 307?
307 method और body को सुरक्षित रखता है; 302 ऐतिहासिक रूप से clients को POST से GET पर switch करने देता था। नए काम में 307 उपयोग करना चाहिए (या permanent के लिए 308)।