Bird
0
0

Which of the following is a correct REST API URL syntax avoiding verbs?

easy📝 Syntax Q3 of 15
Rest API - URL and Resource Design
Which of the following is a correct REST API URL syntax avoiding verbs?
A/createProduct/123
B/updateProduct/123
C/deleteProduct/123
D/products/123
Step-by-Step Solution
Solution:
  1. Step 1: Check URL structure

    REST URLs should use nouns to represent resources, not verbs.
  2. Step 2: Identify verb usage

    '/createProduct/123', '/deleteProduct/123', and '/updateProduct/123' contain verbs like 'create', 'delete', and 'update', which violate REST URL design.
  3. Final Answer:

    /products/123 -> Option D
  4. Quick Check:

    Correct REST URL syntax = /products/123 [OK]
Quick Trick: Use resource names only in URLs, no verbs [OK]
Common Mistakes:
MISTAKES
  • Adding verbs in URL paths
  • Confusing URL path with HTTP method
  • Using action words in resource identifiers

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes