Bird
0
0

Why should REST API URLs use nouns instead of verbs?

easy📝 Conceptual Q1 of 15
Rest API - URL and Resource Design
Why should REST API URLs use nouns instead of verbs?
ABecause verbs make URLs shorter
BBecause nouns are only used for actions
CBecause verbs are harder to type
DBecause URLs represent resources, which are nouns
Step-by-Step Solution
Solution:
  1. Step 1: Understand REST API URL purpose

    REST API URLs represent resources, which are things or objects, best described by nouns.
  2. Step 2: Compare nouns vs verbs in URLs

    Using verbs implies actions, but REST uses HTTP methods (GET, POST) to express actions, so URLs stay as nouns.
  3. Final Answer:

    Because URLs represent resources, which are nouns -> Option D
  4. Quick Check:

    REST URL structure = nouns [OK]
Quick Trick: Use nouns in URLs; verbs go in HTTP methods [OK]
Common Mistakes:
  • Using verbs in URL paths
  • Confusing resource with action
  • Ignoring HTTP methods role

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes