200-301 Question 488
Select 2A network engineer is developing an application that interacts with a REST-based API to manage network devices. The engineer needs to ensure secure communication and proper usage of the API while performing CRUD operations. Which two characteristics are true about REST-based APIs in this scenario?
- A
HTTP verbs like GET, POST, PUT, and DELETE are used to perform CRUD operations.
- B
REST APIs require sessions to maintain state information between client and server.
- C
Authentication methods like API keys, OAuth, or Basic Authentication are used to secure API access.
- D
PUT and DELETE HTTP verbs are always idempotent in REST-based APIs.
- E
REST APIs use XML exclusively as the data exchange format.
Show answer and explanation
Correct answers: A, C
Explanation
REST-based APIs operate using HTTP verbs to perform CRUD operations and are stateless by design. Security is implemented through various authentication methods like API keys and OAuth. While PUT and DELETE are often idempotent, this depends on API implementation. JSON is the most commonly used data format, not XML.
- A. Correct.
HTTP verbs like GET, POST, PUT, and DELETE are fundamental to REST APIs and correspond to CRUD operations: GET (Retrieve), POST (Create), PUT (Update), DELETE (Remove).
- B. Incorrect.
REST APIs are stateless, meaning they do not require sessions to maintain state information between the client and server. Each request contains all necessary information.
- C. Correct.
Authentication methods such as API keys, OAuth, and Basic Authentication are commonly implemented to secure REST API access.
- D. Incorrect.
PUT and DELETE are generally idempotent, but this depends on the specific implementation of the API and adherence to REST principles.
- E. Incorrect.
REST APIs are not restricted to XML; they typically use JSON as the primary data exchange format, though XML is still supported in some cases.