HTTP Status Codes Reference
مرجع شامل وقابل للبحث لجميع رموز حالة HTTP القياسية — من 1xx إلى 5xx. قم بالتصفية حسب الفئة، والبحث حسب رقم الرمز أو الوصف.
HTTP Status Codes Reference
Showing 60 of 60 codes
Server has received request headers; client should proceed.
Server is switching to a different protocol as requested.
The request succeeded.
A new resource was successfully created.
Request accepted but not yet completed.
Metadata differs from the origin server.
Request succeeded; no response body.
Request succeeded; client should reset the document view.
Partial resource returned due to range request.
Multiple status codes for multiple operations.
Members already enumerated in a previous reply.
Response is a result of instance manipulations.
Multiple representations available; user must choose.
Resource permanently moved to a new URL.
Resource temporarily at a different URL.
Redirect to a different URL with GET.
Resource unchanged; use cached version.
Must access through a specified proxy.
Temporary redirect; preserve HTTP method.
Permanent redirect; preserve HTTP method.
Server cannot process the request due to client error.
Authentication is required.
Payment required to access this resource.
Server refuses to fulfil the request.
The requested resource does not exist.
HTTP method not supported for this endpoint.
Cannot produce a response matching Accept headers.
Proxy authentication is required.
Server timed out waiting for the request.
Request conflicts with the current state.
Resource permanently deleted and will not return.
Content-Length header is required.
Precondition in headers evaluated to false.
Request body exceeds server size limit.
The request URL is too long.
Request Content-Type is not supported.
Requested byte range cannot be satisfied.
Server cannot meet the Expect header requirement.
The server is a teapot — an April Fools' joke code.
Request directed at a server unable to produce a response.
Request is well-formed but contains semantic errors.
The resource is locked (WebDAV).
Request failed because a dependency failed (WebDAV).
Server unwilling to process a potentially replayed request.
Client must upgrade to a different protocol.
Conditional request header required.
Rate limit exceeded.
Request headers are too large.
Resource unavailable due to legal restrictions.
Unexpected server-side error.
Server does not support the request method.
Invalid response from an upstream server.
Server temporarily unable to handle the request.
Upstream server did not respond in time.
HTTP version not supported.
Content negotiation circular reference.
Server has insufficient storage (WebDAV).
Infinite loop detected (WebDAV).
Further extensions required to process the request.
Client must authenticate to access the network.
ما هي رموز حالة HTTP؟
رموز حالة HTTP هي أرقام مكونة من ثلاثة أرقام يعيدها الخادم استجابةً لطلب العميل. يحدد الرقم الأول فئة الاستجابة: 1xx معلوماتي، 2xx نجاح، 3xx إعادة توجيه، 4xx أخطاء العميل، و 5xx أخطاء الخادم. يجب أن تتضمن كل استجابة HTTP رمز حالة.
لماذا تأهمية رموز الحالة؟
رموز الحالة هي الطريقة الأساسية لخوادم الويب للتواصل بنتيجة الطلب. تحسن رموز الحالة الصحيحة تحسين محرك البحث (على سبيل المثال 301 مقابل 302 لإعادة التوجيه)، وتمكن معالجة الأخطاء الصحيحة في العملاء، وهي حرجة لتصميم REST API. قد يؤدي استخدام الرمز الخاطئ إلى مشاكل في التخزين المؤقت أو كسر منطق العميل أو تضليل زحافات محرك البحث.
كيفية الاستخدام
- اكتب رقم رمز أو كلمة رئيسية في مربع البحث لتصفية فوري.
- انقر على علامة تبويب فئة لتضييق النتائج على فئة معينة.
- انقر على أي صف لتوسيع الوصف الكامل، وملاحظات الاستخدام، والأسباب الشائعة.
- استخدم زر النسخ على أي صف لنسخ رمز الرقم إلى الحافظة.
الأسئلة الشائعة
- ما الفرق بين 301 و 302؟
- 301 Moved Permanently يخبر العملاء ومحركات البحث أن المورد قد انتقل إلى عنوان URL جديد إلى الأبد — يجب على العملاء تحديث الإشارات المرجعية وتنقل محركات البحث قيمة الارتباط. 302 Found هي إعادة توجيه مؤقتة؛ يجب على العملاء الاستمرار في استخدام عنوان URL الأصلي للطلبات المستقبلية.
- متى يجب أن أستخدم 400 مقابل 422؟
- استخدم 400 Bad Request للصيغة المشوهة أو الحقول المفقودة المطلوبة التي تجعل الطلب غير قابل للتحليل. استخدم 422 Unprocessable Content (سابقاً 422 Unprocessable Entity) عندما تكون الصيغة صحيحة لكن التعليمات الواردة فيها لا يمكن متابعتها — على سبيل المثال، نص JSON صحيح تماماً لكنه يفشل في قواعد التحقق من الأعمال.
- ماذا يعني 503 وما الفرق بينه وبين 500؟
- 500 Internal Server Error يعني أن الخادم واجه حالة غير متوقعة — حل شامل عام للاستثناءات غير المعالجة. 503 Service Unavailable يعني أن الخادم غير قادر مؤقتاً على معالجة الطلب، عادة بسبب الصيانة أو الإرهاق. يعني 503 حالة مؤقتة وغالباً ما يصحبه رأس Retry-After.
- هل يجب على REST API أن يعيد 200 أو 204 للحذف؟
- 204 No Content هي الاستجابة المفضلة لحذف ناجح عندما لا يكون هناك جسم للعودة. استخدم 200 OK إذا كنت تريد إعادة جسم (على سبيل المثال، المورد المحذوف أو رسالة تأكيد). كلاهما صحيح؛ 204 يستخدم على نطاق واسع في REST APIs الحديثة.