Bird
0
0

Find the problem with this URL for updating a user: /updateUser/45

medium📝 Debug Q7 of 15
Rest API - URL and Resource Design
Find the problem with this URL for updating a user: /updateUser/45
AUser ID should be a query parameter
BURL contains a verb; REST URLs should use nouns
CURL should end with a slash
DUser ID should be omitted
Step-by-Step Solution
Solution:
  1. Step 1: Analyze URL naming conventions

    The URL uses 'updateUser', a verb, which is against REST principles.
  2. Step 2: Recall REST URL best practices

    REST URLs should use nouns for resources; actions like update go in HTTP methods (PUT/PATCH).
  3. Final Answer:

    URL contains a verb; REST URLs should use nouns -> Option B
  4. Quick Check:

    REST URLs = nouns, not verbs [OK]
Quick Trick: Use HTTP methods for actions, not verbs in URLs [OK]
Common Mistakes:
  • Putting verbs in URL paths
  • Misusing query parameters for IDs
  • Ignoring HTTP method roles

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes