A network automation engineer is creating a script to manage device configurations via a Cisco RESTful API. Which two statements accurately describe the operational characteristics of HTTP verbs and request headers in this REST-based architecture?
- An HTTP PUT request sent to a configuration resource endpoint replaces the target resource in its entirety with the payload supplied in the request.Answer
- The Content-Type request header communicates to the REST API server the specific data serialization format used within the request body.Answer
- CAn HTTP PATCH request requires the payload to contain a full representation of all resource attributes to avoid deleting unreferenced fields.
- DThe HTTP POST method is inherently idempotent, ensuring that repeated identical requests to a resource endpoint yield identical server resources.
Answer
The two correct statements are that an HTTP PUT request replaces the target resource in its entirety with the provided payload, and the Content-Type request header specifies the serialization format of the request body.
In RESTful web services, HTTP PUT maps to replacing an existing resource in its entirety with the payload sent by the client. Additionally, the Content-Type request header explicitly tells the API server how to deserialize the incoming payload format (e.g., application/json).
Step-by-Step Solution
Key Concept
REST API HTTP Verbs (CRUD operations, idempotency, PUT vs PATCH) and HTTP Headers (Content-Type vs Accept)