Bird
0
0

Examine this REST API request: /api/users?sort=name&direction=descending. What is the issue with the direction parameter?

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

Examine this REST API request: /api/users?sort=name&direction=descending. What is the issue with the direction parameter?

AThe 'direction' parameter should be capitalized
BThe 'sort' parameter should be 'direction' instead
CThe URL is missing the base domain
DThe value 'descending' is invalid; it should be 'desc'
Step-by-Step Solution
Solution:
  1. Step 1: Check valid direction values

    Most REST APIs accept 'asc' or 'desc' for direction.
  2. Step 2: Identify incorrect value

    'descending' is not a standard accepted value.
  3. Final Answer:

    The value 'descending' is invalid; it should be 'desc' -> Option D
  4. Quick Check:

    Use 'asc' or 'desc' only [OK]
Quick Trick: Use 'asc' or 'desc' for direction values [OK]
Common Mistakes:
  • Using full words like 'descending' instead of 'desc'
  • Confusing parameter names
  • Assuming case sensitivity matters

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes