200-901 Question 3
Single answerA developer is designing a REST API that will exchange data between a client and a server. The developer needs a lightweight, human-readable data format with broad support in web technologies. Which data format should the developer choose?
- A
XML
- B
JSON
- C
YAML
- D
CSV
Show answer and explanation
Correct answer: B
Explanation
JSON is the most suitable choice for modern web APIs due to its lightweight nature, human readability, and broad adoption across web technologies. While XML and YAML have their use cases, they are either more verbose or less commonly used for APIs. CSV is not designed for hierarchical or nested data, making it unsuitable for most API interactions.
- A. Incorrect.
XML (Extensible Markup Language) is a structured data format, but it is more verbose compared to JSON and less commonly used in modern web APIs.
- B. Correct.
JSON (JavaScript Object Notation) is a lightweight, human-readable format widely used in web APIs due to its simplicity and compatibility with web technologies.
- C. Incorrect.
YAML (YAML Ain't Markup Language) is human-readable but is less commonly used for web APIs and is more popular for configuration files.
- D. Incorrect.
CSV (Comma-Separated Values) is suitable for tabular data but lacks the hierarchical structure needed for complex data exchange in APIs.