CCNP Automation Practice Question
A network engineer is using the RESTCONF API on a Cisco IOS XE device to configure an interface. The engineer sends a PATCH request to the URL https://device/restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet1 with the following JSON payload: {"ietf-interfaces:interface": {"description": "Uplink to Core"}}. The request returns a 400 Bad Request error. What is the most likely reason for this error?
⚠ Common exam trap
The trap here is focusing on the HTTP method or URL structure while overlooking the mandatory Content-Type header required by RESTCONF for JSON payloads.
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
✓
The Content-Type header is missing or incorrect; it should be application/yang-data+json.
RESTCONF requires the Content-Type header to be 'application/yang-data+json' for JSON payloads. Without this header, the server cannot interpret the payload and returns a 400 Bad Request. The PATCH method is supported, the URL path is correct, and the interface name does not need encoding. Ensuring the correct media type resolves the error.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The URL should use the data store 'running' instead of 'data'.
Why it's wrong here
The RESTCONF URL path '/restconf/data' is correct for accessing configuration and state data. The 'running' data store is accessed via '/restconf/data' by default, but the URL can also include '/restconf/data/ietf-interfaces:interfaces/...' which is valid. Using 'running' explicitly is not required and would not cause a 400 error. The issue lies elsewhere.
- ✓
The Content-Type header is missing or incorrect; it should be application/yang-data+json.
Why this is correct
RESTCONF requires the Content-Type header to be set to 'application/yang-data+json' when sending JSON payloads. If the header is missing or set to 'application/json', the server may reject the request with a 400 Bad Request. The engineer must include the correct media type to ensure the server parses the payload correctly.
- ✗
The PATCH method is not supported by RESTCONF; PUT should be used instead.
Why it's wrong here
RESTCONF supports PATCH for partial modifications. The error is not due to the HTTP method but likely due to the payload structure. PATCH is valid and commonly used to update specific fields. Using PUT would replace the entire interface configuration, which is not desired here. The 400 indicates a client error, such as malformed JSON or incorrect content type.
- ✗
The interface name must be URL-encoded, so GigabitEthernet1 should be GigabitEthernet%31.
Why it's wrong here
Interface names in RESTCONF URLs are typically not URL-encoded unless they contain special characters. 'GigabitEthernet1' is a valid identifier and does not require encoding. URL-encoding the '1' as %31 is unnecessary and would likely cause a different error. The 400 error is more likely due to a missing or incorrect Content-Type header.
Visual reference
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.