Bird
0
0

What is wrong with this request: /products?fields=products=name,price?

medium📝 Debug Q7 of 15
Rest API - Advanced Patterns
What is wrong with this request: /products?fields=products=name,price?
ANo brackets needed around resource name
BIncorrect syntax; should use fields[products]=name,price
CUsing fields parameter instead of filter
DMissing comma between fields
Step-by-Step Solution
Solution:
  1. Step 1: Review sparse fieldsets syntax

    The correct syntax requires square brackets around the resource name.
  2. Step 2: Identify the error

    Using fields=products=name,price is invalid; it should be fields[products]=name,price.
  3. Final Answer:

    Incorrect syntax; should use fields[products]=name,price -> Option B
  4. Quick Check:

    Resource name must be in brackets in fields parameter [OK]
Quick Trick: Always use fields[resource]=field1,field2 syntax [OK]
Common Mistakes:
MISTAKES
  • Omitting brackets
  • Using equals inside fields value
  • Confusing with filter parameter

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes