Bird
0
0

How can you combine pagination and filtering in a GET request URL to fetch page 3 of users with role 'admin' and 10 users per page?

hard📝 Application Q9 of 15
Rest API - HTTP Methods
How can you combine pagination and filtering in a GET request URL to fetch page 3 of users with role 'admin' and 10 users per page?
A/users?filter=role:admin;page=3;limit=10
B/users/role/admin/page/3/limit/10
C/users?page=3&role=admin&per_page=10
D/users?role=admin&page=3&limit=10
Step-by-Step Solution
Solution:
  1. Step 1: Understand combining filters and pagination

    Use query parameters with keys for role, page, and limit.
  2. Step 2: Identify correct URL format

    /users?role=admin&page=3&limit=10 correctly combines filtering and pagination.
  3. Final Answer:

    /users?role=admin&page=3&limit=10 -> Option D
  4. Quick Check:

    Combine filters and pagination with query params [OK]
Quick Trick: Chain filters and pagination with & in query [OK]
Common Mistakes:
MISTAKES
  • Using path segments for filters
  • Wrong parameter names
  • Using semicolons instead of &

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes