تصميم عناوين URL
في هذا الدرس 4 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
write URLs that are predictable.
الموضوعات المخطط لها
- Use plural nouns for collections:
/products,/categories. - Identify one item by its ID:
/products/5. - Nest only one or two levels:
/categories/3/productsis fine; deeper is hard to use. - Lowercase, hyphens for words (
/order-items), no trailing slash, no file extensions. - Filters, sorting, and paging go in the query string:
/products?category=3&sort=price.
تفاصيل المخطط المبدئي
عرض عملي
GET /products list
POST /products create
GET /products/5 read
PUT /products/5 replace
DELETE /products/5 removeاختبر فهمك
Where does ?page=2 belong?
أظهر الإجابة
In the query string.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.