Complete the code to specify the HTTP method used to retrieve data in REST API design.
To fetch data from a REST API, the client sends a [1] request.
The GET method is used to retrieve data from a server without modifying it.
Complete the code to define the correct status code for a successful resource creation in REST API.
When a new resource is created successfully, the server responds with status code [1].
Status code 201 means 'Created', indicating the resource was successfully created.
Fix the error in the REST API endpoint path to follow best practices for resource naming.
The incorrect endpoint path is: '/getUserDetails/[1]'. Correct it to a RESTful style.
RESTful APIs use plural nouns for resource names, so '/users/{id}' is correct.
Fill both blanks to complete the REST API design for updating a resource using the correct HTTP method and status code.
To update a resource, the client sends a [1] request, and the server responds with status code [2] if successful.
PUT is used to update a resource fully, and 200 means the update was successful with content returned.
Fill all three blanks to complete the REST API design snippet for deleting a resource, including HTTP method, endpoint path, and expected status code.
The client sends a [1] request to '[2]/[3]' to delete a resource, and the server responds with status code 204.
DELETE method is used to remove a resource at '/users/123'. Status 204 means success with no content returned.