Bird
0
0

Identify the error in this API call: /api/items?limit=-5&offset=10

medium📝 Debug Q6 of 15
Rest API - Query Parameters and Filtering

Identify the error in this API call: /api/items?limit=-5&offset=10

ANo error, this is valid
BOffset cannot be positive
CLimit cannot be negative
DLimit and offset must be strings
Step-by-Step Solution
Solution:
  1. Step 1: Check limit value

    Limit must be a positive number; negative values are invalid.
  2. Step 2: Check offset value

    Offset can be zero or positive; 10 is valid.
  3. Final Answer:

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

    Limit negative = invalid [OK]
Quick Trick: Limit must be positive; negative values cause errors [OK]
Common Mistakes:
  • Allowing negative limit values
  • Thinking offset cannot be positive
  • Confusing data types for parameters

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes