Question

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

A network automation engineer is building a Python script to interact with a Cisco REST-based API. Match each HTTP request verb on the left to its corresponding operational characteristic or CRUD function on the right.

  • POSTCreates a new resource container or sub-resource item under a target URI
  • GETRetrieves resource representation and configuration data without making modifications
  • PUTReplaces the entire target resource representation with the provided payload
  • PATCHApplies partial modifications to specific fields of an existing resource

Answer

POST matches with creating a new resource under a target URI, GET matches with retrieving resource representation without making modifications, PUT matches with replacing the entire target resource with the provided payload, and PATCH matches with applying partial modifications to specific fields of an existing resource.
Each HTTP verb directly aligns with specific REST CRUD semantics: POST creates new resources under an endpoint; GET retrieves existing resource states safely; PUT overwrites and completely replaces the target resource entity; and PATCH modifies select attributes of an existing resource without disturbing unreferenced attributes.

Step-by-Step Solution

1
Identify the primary CRUD operations for retrieve and create actions in REST APIs.
POST corresponds to resource creation (Create), while GET corresponds to retrieving data (Read).
GET is an idempotent and safe read-only operation, whereas POST sends data to create a new resource entry.
2
Distinguish between full replacement (PUT) and partial update (PATCH) behaviors.
PUT completely overwrites the existing target resource, while PATCH modifies only specified resource fields.
PUT requires a complete resource representation in the request payload, whereas PATCH updates targeted attributes without modifying omitted fields.

Key Concept

REST HTTP Verbs to CRUD Operations Mapping
Rate this question