Complete the code to create a REST API endpoint URL that avoids verbs.
GET /api/[1]In REST APIs, URLs should use nouns to represent resources, not verbs. 'users' is a noun representing the resource.
Complete the URL to correctly represent a resource collection without verbs.
POST /api/[1]POST requests to a resource collection URL like 'users' create new resources. The URL should not contain verbs.
Fix the error in the URL by replacing the verb with a noun.
DELETE /api/[1]/123
The URL should use the resource name 'users' instead of verbs like 'deleteUser'. The HTTP method DELETE indicates the action.
Fill both blanks to create a RESTful URL that avoids verbs and correctly identifies a single resource.
PUT /api/[1]/[2]
The URL uses 'users' as the resource and '123' as the resource ID. The PUT method indicates updating the resource, so no verbs are needed in the URL.
Fill all three blanks to create a RESTful URL that avoids verbs and correctly accesses a sub-resource.
GET /api/[1]/[2]/[3]
The URL accesses the 'orders' sub-resource of the user with ID '123'. All parts are nouns representing resources. The HTTP GET method specifies the action.