Question

Difficulty: MediumCharacteristics of REST-Based APIs (CRUD, HTTP Verbs, Data Formats)

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?

  1. HTTP PUTAnswer
  2. B
    HTTP PATCH
  3. C
    HTTP POST
  4. D
    HTTP 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

1
Analyze the operational outcome described in the scenario.
The target configuration was updated, but omitted fields (secondary syslog IP and logging severity) were removed and reset to default values.
Understanding how different HTTP verbs handle missing payload attributes is critical in REST API interactions.
2
Compare HTTP update verbs (PUT vs. PATCH).
HTTP PUT is specified as a full resource replacement (Update/Replace), whereas HTTP PATCH is defined as a partial update (Modify).
Sending a partial payload with HTTP PUT forces the API server to overwrite the existing resource with the provided fields and set unspecified fields to null or default values.

Key Concept

Operational Differences Between HTTP PUT and HTTP PATCH in REST APIs
Rate this question