200-901 Question 4
Single answerA developer is working on a network automation script that interacts with APIs and configuration files. The developer needs to choose a data format that is human-readable, supports complex structures like nested objects, and is widely used for RESTful API responses. Which data format is the best choice?
- A
XML
- B
JSON
- C
YAML
- D
CSV
Show answer and explanation
Correct answer: B
Explanation
JSON is the best choice because it strikes a good balance between readability, support for complex data structures, and its widespread adoption for RESTful API responses. While XML and YAML also support complex structures, JSON's widespread use in APIs makes it the ideal format for this specific use case.
- A. Incorrect.
XML is human-readable and supports complex structures, but it is more verbose compared to JSON and YAML. It is less commonly used for RESTful API responses.
- B. Correct.
JSON is human-readable, supports complex structures like nested objects, and is the most widely used format for RESTful API responses, making it the best choice for this scenario.
- C. Incorrect.
YAML is human-readable and supports complex structures, but it is typically used in configuration files rather than RESTful API responses.
- D. Incorrect.
CSV (Comma-Separated Values) is not suitable for representing complex data structures like nested objects, nor is it commonly used for RESTful API responses.