(1) Web Services Error Spotting Questions and Answers
1
Identify the error in the following RESTful API endpoint definition:
GET /api/users/{id}/delete
The HTTP method should be DELETE.
The endpoint should not include {id}.
/delete should be replaced with /remove.
None of the above
Explanation:
Option B is correct because {id} is typically used to denote a variable path parameter in RESTful APIs, but in this case, using it within /delete suggests a misunderstanding of RESTful conventions. The correct endpoint might be DELETE /api/users/{id} to delete a specific user.