Bird
0
0

Which of the following is the correct way to request only the 'name' and 'email' fields using query parameters?

easy📝 Syntax Q12 of 15
Rest API - Query Parameters and Filtering
Which of the following is the correct way to request only the 'name' and 'email' fields using query parameters?
A/users?fields=name,email
B/users?filter=name,email
C/users?sort=name,email
D/users?select=name,email
Step-by-Step Solution
Solution:
  1. Step 1: Identify query parameter for selecting fields

    The 'fields' parameter is used to specify which fields to return.
  2. Step 2: Match correct syntax

    Using 'fields=name,email' correctly requests only those fields.
  3. Final Answer:

    /users?fields=name,email -> Option A
  4. Quick Check:

    fields param selects fields [OK]
Quick Trick: Use 'fields' param to pick specific data fields [OK]
Common Mistakes:
  • Using 'filter' to select fields instead of filter data
  • Using 'sort' to select fields
  • Using 'select' which is not standard here

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes