HTTP स्टेटस कोड

HTTP स्टेटस कोड संदर्भ

डेवलपर टूल्स

HTTP स्टेटस कोड का उपयोग कैसे करें

  1. 1नंबर या नाम से स्टेटस कोड खोजें
  2. 2या category के अनुसार ब्राउज़ करें
  3. 3विस्तृत व्याख्या और उपयोग पढ़ें

HTTP स्टेटस कोड के बारे में

HTTP स्टेटस कोड संदर्भ सभी HTTP response codes का एक व्यापक गाइड है जिसमें प्रत्येक code की विस्तृत व्याख्या है।

HTTP स्टेटस कोड की मुख्य विशेषताएं

  • Complete reference for all standard HTTP status codes (1xx–5xx)
  • Includes non-standard but widely used codes: 418, 429, 451
  • Plain-English description for each code
  • Search by code number or keyword
  • Filter by category: 1xx Informational, 2xx Success, 3xx Redirection, 4xx Client Error, 5xx Server Error
  • Common use cases and examples for each code
  • Works entirely in-browser — no server requests
  • Fast instant-search with no loading delay

उदाहरण

Look up the correct code for a successful resource creation

Find which 2xx code to return from a POST endpoint that creates a new resource.

इनपुट

Search: "created" or code 201

आउटपुट

201 Created — Used when a new resource has been created. Include a Location header pointing to the new resource URL.

Find the right error code for a rate-limited API response

Identify the standard code for communicating that a client has exceeded API rate limits.

इनपुट

Search: "rate limit" or code 429

आउटपुट

429 Too Many Requests — Include a Retry-After header indicating when the client can retry.

सामान्य उपयोग के मामले

  • Looking up the correct status code to return from a REST API endpoint
  • Debugging HTTP errors by understanding what a specific code means
  • Designing error handling in API client code for different response categories
  • Learning HTTP semantics when building or documenting an API
  • Reviewing API designs to check that status codes are used appropriately
  • Quick reference during development without leaving your browser tab

समस्या निवारण

Using 200 OK for all responses including errors

समाधान

Always use the semantically correct status code. Returning 200 with an error in the response body breaks HTTP semantics and makes debugging harder. Use 4xx for client errors and 5xx for server errors.

Confusing 401 and 403

समाधान

401 Unauthorized means the client is not authenticated (no valid credentials provided). 403 Forbidden means the client is authenticated but does not have permission to access the resource. Use 401 for missing/invalid auth, 403 for insufficient permissions.

Using 404 for authentication failures

समाधान

Returning 404 instead of 401/403 for protected resources is a security technique to prevent resource enumeration, but it can confuse legitimate clients. Document your choice clearly in your API specification.

अक्सर पूछे जाने वाले प्रश्न

Are all HTTP status codes listed?

Yes. All standard RFC 7231 status codes plus commonly used unofficial codes like 418 (I'm a Teapot), 429 (Too Many Requests), and 451 (Unavailable for Legal Reasons) are included.

What is the difference between 401 and 403?

401 Unauthorized indicates the request requires authentication and no valid credentials were provided. 403 Forbidden indicates the server understood the request but refuses to authorize it — the user is authenticated but lacks permission.

When should I use 200 vs 201 vs 204?

200 OK for successful GET requests, 201 Created for successful POST requests that create a resource, and 204 No Content for successful DELETE or PATCH requests that return no body.

What does 422 Unprocessable Entity mean?

422 indicates the request was well-formed (valid syntax) but semantically incorrect — the server understands the content type and syntax but cannot process the contained instructions. Common in REST APIs for validation errors.

What is the correct status code for a redirect?

301 Moved Permanently for permanent URL changes (browsers cache this), 302 Found for temporary redirects, and 307/308 to preserve the HTTP method (GET/POST) during the redirect.

When should I return 503 instead of 500?

500 Internal Server Error indicates an unexpected server-side failure. 503 Service Unavailable indicates the server is temporarily unable to handle the request (overloaded or under maintenance) and the client should retry later.

Is my data sent to a server?

No. The status code reference is statically loaded in your browser. No search queries or user interactions are transmitted to any server.

What does the 1xx status code range mean?

1xx codes are informational — they indicate the request was received and processing is continuing. The most common is 100 Continue, used when a client needs to send a large request body and checks if the server is willing to accept it first.