Bird
0
0

An API returns an error when requesting /api/items?page=5&limit=-10. What is the cause?

medium📝 Debug Q7 of 15
Rest API - Pagination Patterns
An API returns an error when requesting /api/items?page=5&limit=-10. What is the cause?
APage number cannot be 5
BLimit cannot be negative
CLimit must be zero
DPage parameter is missing
Step-by-Step Solution
Solution:
  1. Step 1: Check the limit parameter

    Limit defines how many items per page and must be a positive number.
  2. Step 2: Identify invalid value

    Limit is set to -10, which is invalid and causes an error.
  3. Final Answer:

    Limit cannot be negative -> Option B
  4. Quick Check:

    Limit must be positive [OK]
Quick Trick: Limit must be a positive number [OK]
Common Mistakes:
  • Using negative limit values
  • Thinking page number is invalid
  • Ignoring missing parameters

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes