Bird
0
0

You want to get a list of blog posts with each post's author and comments embedded. Which request is correct?

hard📝 Application Q8 of 15
Rest API - Advanced Patterns
You want to get a list of blog posts with each post's author and comments embedded. Which request is correct?
A/posts?fields=author,comments
B/posts?expand=author,comments
C/posts?include=author,comments
D/posts?expand=author&expand=comments
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct parameter for expansion

    'expand' is the standard parameter to embed related data.
  2. Step 2: Check syntax for multiple expansions

    Multiple fields are comma-separated in a single 'expand' parameter.
  3. Step 3: Evaluate options

    /posts?expand=author,comments correctly uses one expand with comma-separated fields; others are invalid or wrong parameters.
  4. Final Answer:

    /posts?expand=author,comments -> Option B
  5. Quick Check:

    Multiple expansions use one expand with commas [OK]
Quick Trick: Use one expand param with commas for multiple fields [OK]
Common Mistakes:
MISTAKES
  • Using multiple expand params
  • Using include or fields instead of expand
  • Separating fields incorrectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes