Recall & Review
beginner
What does a well-structured URL communicate in a REST API?
A well-structured URL clearly shows the resource being accessed and the action intended, making it easy to understand and use.
Click to reveal answer
beginner
Why is it important to use nouns in URL paths instead of verbs?
Using nouns focuses on the resource itself, while HTTP methods (GET, POST, etc.) describe the action, keeping URLs simple and meaningful.
Click to reveal answer
intermediate
How does URL structure improve API usability?
Clear URL structure helps developers guess endpoints easily, reduces errors, and improves readability and maintainability of the API.
Click to reveal answer
intermediate
What role do hierarchical paths in URLs play in communicating meaning?
Hierarchical paths show relationships between resources, like a folder structure, helping users understand context and organization.
Click to reveal answer
beginner
Give an example of a meaningful URL structure for accessing a user's orders.
Example: /users/123/orders - This URL clearly shows orders belong to user with ID 123.
Click to reveal answer
Which part of a REST API URL should represent the resource?
✗ Incorrect
The path in the URL represents the resource, while HTTP methods describe the action.
Why should URLs avoid verbs like 'get' or 'create' in their paths?
✗ Incorrect
HTTP methods like GET or POST specify the action, so URLs should focus on the resource (nouns).
What does a hierarchical URL path indicate?
✗ Incorrect
Hierarchical paths show how resources are related, like folders inside folders.
Which URL is more meaningful for accessing a specific order of a user?
✗ Incorrect
The URL /users/456/orders/123 clearly shows the order 123 belongs to user 456.
How does a clear URL structure help developers?
✗ Incorrect
Clear URLs help developers understand and use the API without confusion.
Explain why URL structure is important in communicating meaning in REST APIs.
Think about how URLs help users understand what data or action is involved.
You got /4 concepts.
Describe how hierarchical URL paths show relationships between resources with an example.
Imagine folders inside folders on your computer.
You got /3 concepts.