Bird
0
0

Why should verbs be avoided in REST API URLs?

easy📝 Conceptual Q2 of 15
Rest API - URL and Resource Design
Why should verbs be avoided in REST API URLs?
ABecause verbs improve URL readability
BBecause HTTP methods already define actions
CBecause verbs make URLs shorter
DBecause verbs are required in URLs
Step-by-Step Solution
Solution:
  1. Step 1: Understand HTTP methods role

    HTTP methods like GET, POST, PUT, DELETE define the action to perform on a resource.
  2. Step 2: Reason about URL design

    URLs should represent resources (nouns), while HTTP methods specify the action (verbs). Including verbs in URLs is redundant and against REST principles.
  3. Final Answer:

    Because HTTP methods already define actions -> Option B
  4. Quick Check:

    HTTP methods = verbs, URLs = nouns [OK]
Quick Trick: Let HTTP methods handle actions, keep URLs as nouns [OK]
Common Mistakes:
  • Thinking verbs improve URL clarity
  • Mixing HTTP methods and URL paths
  • Using verbs in URLs to describe actions

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes