A network automation engineer is designing Python scripts to interact with Cisco DNA Center and RESTCONF API endpoints for network configuration management. Which two statements accurately describe the characteristics and operational mechanics of HTTP verbs, headers, and data formats used in REST-based APIs? (Select two.)
- HTTP PUT requests are idempotent and replace the specified resource entirely with the request payload, whereas HTTP PATCH requests apply partial modifications to an existing resource.Answer
- BHTTP POST operations are inherently idempotent, making them safe to execute repeatedly with identical payloads without creating duplicate server resources.
- The Content-Type HTTP header informs the server of the data format contained in the request body, while the Accept header specifies the data format expected in the response.Answer
- DIn JSON-encoded REST payloads, square brackets `[]` are used to define key-value dictionary objects, while curly braces `{}` represent ordered lists of items.
Answer
The two correct characteristics of REST-based APIs are: (1) HTTP PUT requests are idempotent and perform a full resource replacement while HTTP PATCH applies partial updates, and (2) the Content-Type header defines the request payload format while the Accept header defines the expected response format.
The statement regarding HTTP PUT being idempotent and replacing the resource fully while HTTP PATCH applies partial updates is correct, as PUT replaces the target entity entirely and repeating the request results in the same server state, whereas PATCH modifies only the specified attributes. Additionally, the statement regarding Content-Type specifying the request payload format and Accept specifying the desired response format is correct, as Content-Type tells the server how to parse the incoming payload while Accept expresses client preference for the returned payload encoding.
Step-by-Step Solution
Key Concept
Characteristics of REST-Based APIs (HTTP Verbs, Idempotency, Headers, and Data Formats)