A network monitoring portal issues an HTTP request to a Cisco DNA Center REST API endpoint to update the syslog server configuration on a managed switch. The request payload contains only the key-value pair for the primary syslog server IP address. After the API execution completes, an engineer discovers that the secondary syslog server IP address and logging severity level settings were erased and reset to defaults. Which HTTP method was executed by the portal to cause this behavior?
- HTTP PUTAnswer
- BHTTP PATCH
- CHTTP POST
- DHTTP GET
Answer
HTTP PUT is the method executed because it replaces the entire target resource payload, resetting omitted fields to their default state.
The HTTP PUT method maps to the Update/Replace CRUD operation. In RESTful API architectures, sending an HTTP PUT request requires representing the full resource. If an API call provides only a subset of resource fields, the server replaces the whole object, leaving unmentioned properties unassigned or set back to default values.
Step-by-Step Solution
Key Concept
Operational Differences Between HTTP PUT and HTTP PATCH in REST APIs