Bird
0
0

If the request is /movies?fields[movies]=title,director, which fields will the API response include for each movie?

medium📝 Predict Output Q4 of 15
Rest API - Advanced Patterns
If the request is /movies?fields[movies]=title,director, which fields will the API response include for each movie?
AOnly the <code>title</code> and <code>director</code> fields
BAll fields except <code>title</code> and <code>director</code>
COnly the <code>id</code> field
DNo fields will be returned
Step-by-Step Solution
Solution:
  1. Step 1: Understand sparse fieldsets

    The query parameter specifies which fields to include.
  2. Step 2: Interpret the request

    fields[movies]=title,director means only these two fields are returned.
  3. Final Answer:

    Only the title and director fields -> Option A
  4. Quick Check:

    Specified fields are included, others excluded [OK]
Quick Trick: Only requested fields are returned [OK]
Common Mistakes:
MISTAKES
  • Assuming all fields are returned
  • Thinking excluded fields are returned
  • Confusing field names or resource names

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes