300-435 Question 222
Single answerA network engineer is tasked with integrating an automated system to discover devices in the network and retrieve their configuration details. The engineer plans to use a REST API to achieve this. Which API method should the engineer use to collect the current configuration of a device?
- A
GET
- B
POST
- C
PUT
- D
DELETE
Show answer and explanation
Correct answer: A
Explanation
In RESTful APIs, the GET method is designed for retrieving data without modifying the resource. Since the engineer's goal is to discover network devices and retrieve their configuration details, the GET method is the appropriate choice. Other methods like POST, PUT, and DELETE are intended for creating, updating, or deleting resources, which are not applicable to this use case.
- A. Correct.
GET is the correct HTTP method to retrieve information from a device or resource without making any changes to it. In this scenario, the engineer needs to retrieve configuration details, making GET the appropriate method.
- B. Incorrect.
POST is used to create or submit new data to a resource. It is not suitable for retrieving existing data, such as device configurations.
- C. Incorrect.
PUT is used to update or replace a resource on a server. It is not intended for retrieving data, which is required in this scenario.
- D. Incorrect.
DELETE is used to remove a resource from a server. It is not relevant to retrieving configuration details.