What advantage does nesting resources provide when designing RESTful API endpoints?
easy📝 Conceptual Q1 of 15
Rest API - URL and Resource Design
What advantage does nesting resources provide when designing RESTful API endpoints?
AIt reduces the number of HTTP methods needed
BIt clearly shows the hierarchical relationship between resources
CIt eliminates the need for query parameters
DIt allows resources to be accessed without authentication
Step-by-Step Solution
Solution:
Step 1: Understand nested resources
Nesting resources in REST APIs reflects the parent-child relationship between entities.
Step 2: Analyze options
It clearly shows the hierarchical relationship between resources correctly states that nesting clarifies hierarchical relationships. Options B, C, and D are incorrect because nesting does not reduce HTTP methods, eliminate query parameters, or bypass authentication.
Final Answer:
It clearly shows the hierarchical relationship between resources -> Option B