Which endpoint follows REST naming conventions?
Options
POST /createUserGET /getUserById?id=42GET /users/42(Correct option)GET /user_delete/42
Answer
GET /users/42
Why
REST URLs name RESOURCES (nouns, usually plural), and the HTTP method says the action:
GET /users/42read user 42POST /userscreate a userPATCH /users/42updateDELETE /users/42delete
Putting verbs in the URL (/createUser) repeats what the method already says.
Remember
Nouns in the URL, verbs in the HTTP method.