Complete the code to define a REST API endpoint that retrieves all users.
GET /[1]The URL /users clearly indicates the resource being accessed, which is the collection of users.
Complete the URL to access a specific user by their ID.
GET /users/[1]The URL uses id to specify a unique user resource, making the URL meaningful and precise.
Fix the error in the URL that tries to update a user's email.
PUT /users/[1]/updateEmailThe URL should include the user's id to specify which user to update. The action updateEmail is better handled by HTTP method semantics rather than in the URL.
Fill both blanks to create a URL that lists all orders for a specific user.
GET /[1]/[2]/orders
The URL /users/123/orders clearly shows orders belonging to user with ID 123, making the URL meaningful and hierarchical.
Fill all three blanks to create a URL that accesses a specific comment on a post by a user.
GET /[1]/[2]/posts/[3]/comments
The URL /users/456/posts/789/comments clearly shows comments on post 789 by user 456, making the URL structure meaningful and easy to understand.