350-401 Automation Practice Question
A network engineer is writing a Python script to retrieve interface statistics from a Cisco IOS XE device using RESTCONF. The script sends a GET request to https://10.1.1.1/restconf/data/ietf-interfaces:interfaces but receives an HTTP 406 Not Acceptable response. The engineer verifies that the device has RESTCONF enabled and the credentials are correct. Which action should the engineer take to resolve this issue?
⚠ Common exam trap
Watch out — candidates often confuse the Accept header with the Content-Type header, assuming that any media type header will fix the 406 error.
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
✓
Add an Accept header of application/yang-data+json to the request.
The 406 Not Acceptable status code indicates that the server cannot produce a response matching the client's Accept header. In RESTCONF, the client must specify the desired media type, such as application/yang-data+json. Without it, the server may reject the request. Adding the Accept header tells the server to return JSON-encoded YANG data, which is the expected format.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Enable NETCONF on the device and use it instead of RESTCONF.
Why it's wrong here
Switching to NETCONF is unnecessary and does not address the immediate issue. The problem is a missing HTTP header in the RESTCONF request. NETCONF uses a different transport and data encoding, so it would require a completely different implementation. The engineer can resolve the 406 error within RESTCONF by adding the Accept header.
- ✗
Change the HTTP method from GET to POST.
Why it's wrong here
POST is used to create or invoke operations, not to retrieve data. Using POST would not fix the 406 error and is semantically incorrect for a read operation. The 406 status indicates a content negotiation issue, not an HTTP method problem. Changing to POST would likely result in a different error or unintended side effects.
- ✗
Add a Content-Type header of application/yang-data+json to the request.
Why it's wrong here
Content-Type describes the media type of the request body. Since this is a GET request with no body, Content-Type is irrelevant. While some servers might ignore it, it does not address the 406 error, which is about the response format the client will accept. The Accept header is the correct header to modify.
- ✓
Add an Accept header of application/yang-data+json to the request.
Why this is correct
RESTCONF requires the client to specify the desired media type via the Accept header. Without it, the server may return 406 Not Acceptable. Setting Accept: application/yang-data+json tells the server to return data in JSON format, which is the standard for RESTCONF. This directly resolves the 406 error by indicating the client's supported response format.
Visual reference
Go deeper
Related to this question
Learn chapter
SDN Controllers and Cisco ACI
Key term
REST API for Network Devices
A REST API for network devices is a set of rules that allows software applications to communicate with routers, switches, and firewalls using standard web methods like GET, POST, PUT, and DELETE over HTTP or HTTPS.
Key term
NETCONF Protocol
NETCONF is a network management protocol that uses a structured data format to configure, retrieve, and modify network devices in a standard, programmatic way.
About these practice questions
Courseiva writes every 350-401 question from scratch — 1,923 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. 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.