CCNP Automation Practice Question
A network engineer is designing a Python script to interact with a Cisco IOS XE device using RESTCONF. The engineer needs to perform a partial modification of the interface description without affecting other configured parameters. Which two HTTP methods and payload considerations are appropriate for this task? (Choose two.)
⚠ Common exam trap
The trap here is assuming that PUT can be used for partial updates like PATCH, when PUT actually replaces the entire resource and can inadvertently erase other configuration.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Use the PATCH method with a JSON payload containing only the fields to be changed.
Partial modification of a RESTCONF resource is achieved with the PATCH method, which updates only the specified fields. Both JSON and XML payloads are supported, provided the Content-Type header matches the encoding. Using PUT would replace the entire resource, and POST or DELETE are not appropriate for modifying an existing leaf. Therefore, the two correct approaches are PATCH with JSON and PATCH with XML.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Use the PATCH method with a JSON payload containing only the fields to be changed.
Why this is correct
RESTCONF supports the PATCH method to apply partial modifications to a resource. When using PATCH with a JSON payload, only the specified fields are altered, leaving other existing configuration intact. This is ideal for changing a single interface description without overwriting the entire interface configuration. The payload must be structured according to the YANG model, targeting the specific leaf to be modified.
- ✗
Use the POST method to create a new data node for the description under the interface.
Why it's wrong here
POST is typically used to create a new resource within a collection. For an existing interface, the description leaf already exists as part of the interface's data model. Attempting to POST a new description node would likely result in an error or duplicate data. POST is not the correct method for modifying an existing leaf's value; PATCH or PUT are used for updates.
- ✗
Use the DELETE method to remove the existing description and then POST a new one.
Why it's wrong here
Using DELETE followed by POST is a two-step process that is unnecessary and risky. It temporarily removes the description and could fail if the POST is not successful, leaving the interface without a description. RESTCONF provides PATCH and PUT for direct modification, which are safer and atomic. DELETE is intended for removing resources, not for updating a leaf value in this manner.
- ✓
Use the PATCH method with an XML payload and set the Content-Type header to application/yang-data+xml.
Why this is correct
RESTCONF allows both JSON and XML encodings. Using PATCH with an XML payload and the appropriate Content-Type header is valid for partial modifications. The engineer can choose XML instead of JSON as long as the payload is structured correctly and the Content-Type header matches. This method achieves the same partial update as the JSON PATCH approach, making it an appropriate alternative.
- ✗
Use the PUT method with a JSON payload containing only the fields to be changed.
Why it's wrong here
PUT is used to replace a resource entirely. If a JSON payload contains only the description field, a PUT request would replace the entire interface configuration with just that field, potentially removing other settings such as IP address or MTU. To avoid unintended changes, PUT should include the complete representation of the resource, which is not what the engineer wants for a partial modification.
About these practice questions
One of 1,923 original 350-401 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Cisco exam blueprint
This 350-401 practice question is part of Courseiva's free Cisco certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 350-401 exam.