Bird
0
0

Why do most REST APIs use asc and desc instead of full words like 'ascending' or 'descending' for sort direction?

hard📝 Conceptual Q10 of 15
Rest API - Query Parameters and Filtering

Why do most REST APIs use asc and desc instead of full words like 'ascending' or 'descending' for sort direction?

ABecause full words cause syntax errors in URLs
BBecause full words are deprecated in HTTP standards
CBecause 'asc' and 'desc' are case-insensitive keywords
DBecause short codes reduce URL length and improve consistency
Step-by-Step Solution
Solution:
  1. Step 1: Understand URL design principles

    Short parameter values keep URLs concise and easier to read and type.
  2. Step 2: Consider API consistency

    Using standard short codes like 'asc' and 'desc' ensures uniformity across APIs.
  3. Final Answer:

    Because short codes reduce URL length and improve consistency -> Option D
  4. Quick Check:

    Short codes improve URL clarity and consistency [OK]
Quick Trick: Short codes keep URLs simple and consistent [OK]
Common Mistakes:
  • Thinking full words cause errors
  • Believing 'asc'/'desc' are case-insensitive keywords
  • Assuming full words are deprecated

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes