نظرة ثانية على الطرق: الأمان وعدم تأثر النتيجة بالتكرار
في هذا الدرس 4 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
classify HTTP methods and explain why retries depend on it.
الموضوعات المخطط لها
- Safe means the request does not change server state (reading only).
GET,HEAD,OPTIONSare safe. - Idempotent means doing it once or ten times leaves the server in the same state.
GET,PUT,DELETEare idempotent. POSTis neither safe nor idempotent: two identical calls can create two orders.PATCHis not guaranteed idempotent; it depends on what the patch says.- Clients, proxies, and load balancers may retry idempotent calls automatically. A non-idempotent retry can duplicate work.
تفاصيل المخطط المبدئي
عرض عملي
| Method | Safe | Idempotent |
|---|---|---|
| GET | yes | yes |
| PUT | no | yes |
| DELETE | no | yes |
| POST | no | no |
اختبر فهمك
Why is it fine to retry PUT /products/5 after a timeout?
أظهر الإجابة
Repeating it leaves the same final state.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.