200-301 Question 487
Select 4A network engineer is tasked with integrating a REST-based API for a cloud application. The API documentation specifies that the operations include retrieving data, adding new resources, updating existing resources, and deleting resources. What HTTP verbs should the engineer use to perform these actions?
- A
GET
- B
POST
- C
PUT
- D
DELETE
- E
HEAD
- F
PATCH
Show answer and explanation
Correct answers: A, B, C, D
Explanation
REST-based APIs rely on HTTP verbs to perform CRUD operations. For this scenario, GET retrieves data, POST creates data, PUT updates data, and DELETE removes data. These verbs map directly to the specified actions in the question.
- A. Correct.
GET is used to retrieve data from a server, making it the correct HTTP verb for reading operations.
- B. Correct.
POST is used to create new resources on the server, making it the correct HTTP verb for adding new resources.
- C. Correct.
PUT is used to update existing resources on the server, making it the correct HTTP verb for updating resources.
- D. Correct.
DELETE is used to delete resources on the server, making it the correct HTTP verb for removing resources.
- E. Incorrect.
HEAD is not used for resource manipulation but to retrieve header information without the response body, which is unrelated to the specified operations.
- F. Incorrect.
PATCH is used for partial updates to a resource, but the question does not specify partial updates, so it is not applicable.