Bird
0
0

Which of the following is the correct way to request the second page with 10 items per page in a REST API URL?

easy📝 Syntax Q12 of 15
Rest API - Pagination Patterns
Which of the following is the correct way to request the second page with 10 items per page in a REST API URL?
A/api/items?page=2&limit=10
B/api/items?limit=2&page=10
C/api/items?page=10&limit=2
D/api/items?items=10&page=2
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct pagination parameters

    Common pagination uses 'page' for page number and 'limit' for items per page.
  2. Step 2: Match parameters to URL format

    /api/items?page=2&limit=10 uses 'page=2' and 'limit=10', which means second page with 10 items per page.
  3. Final Answer:

    /api/items?page=2&limit=10 -> Option A
  4. Quick Check:

    page=2 and limit=10 means second page, 10 items [OK]
Quick Trick: Page=number, limit=items per page in URL [OK]
Common Mistakes:
  • Swapping page and limit values
  • Using wrong parameter names like 'items'
  • Mixing up page number and item count

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes