An engineer is developing a Python script to interact with the Cisco DNA Center REST API to audit device configurations and modify global settings. Which two statements accurately describe the operational characteristics of HTTP request headers and HTTP verbs used in this REST API environment?
- The Accept HTTP header specifies the media type (such as application/json) that the client expects to receive in the response from the server.Answer
- HTTP PUT operations are idempotent, meaning executing identical requests multiple times results in the same final state on the server.Answer
- CHTTP POST operations are idempotent because sending the exact same payload repeatedly will update the existing resource rather than creating duplicate entries.
- DThe Content-Type request header informs the server which data format the client is willing to accept in the HTTP response body.
Answer
The statement explaining that the Accept header specifies the expected response format and the statement noting that HTTP PUT operations are idempotent are both correct.
The Accept HTTP header is used by the client during request negotiation to specify the payload format (e.g., JSON or XML) expected in the server response. Additionally, HTTP PUT operations are inherently idempotent; submitting the exact same request body multiple times produces the same server state as a single invocation.
Step-by-Step Solution
Key Concept
HTTP headers (Content-Type vs Accept) and verb properties (Idempotency of PUT vs POST)