API Design · Middle · Question 5 of 75
How can a REST API let clients load related resources in one request?
- 1It's impossible; clients must make separate calls
- 2By always returning every related object
- ✓Correct answer: With an expansion parameter like
?include=author,comments(JSON:API) or?expand=customer
Explanation
Expansion avoids chatty clients while keeping default responses small. Limit how deep and how many relations can be included.