Question

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

A network engineer is inspecting an API interaction log between a Python script and a Cisco DNA Center REST API controller. The log indicates that the script transmitted an HTTP request targeting an existing template resource URI using the HTTP PATCH verb. Which statement correctly describes the operational effect of this request on the API controller?

  1. It modifies only the specific attributes provided in the request payload while keeping all other existing resource fields intact.Answer
  2. B
    It creates a new template resource under the specified endpoint collection and assigns a new resource identifier.
  3. C
    It performs a complete replacement of the target resource, overwriting unmentioned fields with default or empty values.
  4. D
    It retrieves the operational data and configuration status of the target template without altering any server-side data.

Answer

The HTTP PATCH request updates only the specific fields included in the payload while preserving unmentioned resource attributes.
In RESTful architecture, the HTTP PATCH method corresponds to the Update operation in CRUD, specifically designed for partial modifications. When a PATCH request is processed, the server updates only the key-value pairs defined in the request body, leaving all other attributes of the target resource unchanged.

Step-by-Step Solution

1
Identify the HTTP verb used in the REST API request.
The request utilizes the HTTP PATCH method.
Mapping the HTTP verb to its corresponding CRUD operation reveals the intended action on the resource.
2
Differentiate HTTP PATCH operational semantics from HTTP PUT and HTTP POST.
HTTP POST creates resources, HTTP PUT completely replaces existing resources, and HTTP PATCH selectively updates specified attributes.
Understanding REST API standards ensures accurate interpretation of API request payloads and controller responses.

Key Concept

REST HTTP Verbs to CRUD Mapping (PATCH vs PUT/POST)
Rate this question