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:
Step 1: Check URL structure
REST URLs should use nouns to represent resources, not verbs.
Step 2: Identify verb usage
'/createProduct/123', '/deleteProduct/123', and '/updateProduct/123' contain verbs like 'create', 'delete', and 'update', which violate REST URL design.
Final Answer:
/products/123 -> Option D
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
Master "URL and Resource Design" in Rest API
9 interactive learning modes - each teaches the same concept differently