Bird
0
0

Which of the following is the correct syntax to filter users by the field 'status' equal to 'active' in a REST API URL?

easy📝 Syntax Q3 of 15
Rest API - Query Parameters and Filtering
Which of the following is the correct syntax to filter users by the field 'status' equal to 'active' in a REST API URL?
A/users?filter=status:active
B/users/status=active
C/users?status=active
D/users#status=active"
Step-by-Step Solution
Solution:
  1. Step 1: Understand query parameter syntax

    Filtering uses query parameters after '?' with key=value pairs, separated by '&' if multiple.
  2. Step 2: Identify correct syntax for filtering by status

    "/users?status=active" correctly uses '?' and '=' for filtering by field value.
  3. Final Answer:

    /users?status=active -> Option C
  4. Quick Check:

    Correct filter syntax = /users?status=active [OK]
Quick Trick: Use ?field=value to filter in REST URLs [OK]
Common Mistakes:
  • Using slash instead of question mark for filters
  • Using hash (#) instead of question mark
  • Incorrect filter format like colon instead of equals

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes