Question 1,151 of 1,819
AI and Network OperationshardConfigurationObjective-mapped

Quick Answer

The answer is that setting the Accept header to application/json instead of application/yang-data+json causes the RESTCONF server to return a 406 Not Acceptable error. This occurs because RESTCONF, as defined in RFC 8040, mandates that all media types use the application/yang-data+json format for request and response bodies; the generic application/json type is not recognized by the server as a valid representation of YANG-encoded data. On the CCNA 200-301 v2 exam, this tests your understanding of RESTCONF’s strict media-type negotiation, often appearing in automation questions where you must construct GET and PATCH requests with proper URIs—like percent-encoding the slash in GigabitEthernet0%2F1—and the correct Accept header. A common trap is assuming any JSON format works, but the server rejects it outright. Remember the mnemonic: “YANG data needs YANG headers” to avoid the 406 snag.

CCNA AI and Network Operations Practice Question

This 200-301 practice question tests your understanding of ai and network operations. The scenario asks you to isolate a root cause — eliminate options that address a different problem before choosing. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

Network Topology
G0/0192.0.2.1/24G0/010.0.0.2/30G0/1 (10.0.0.1/30)R1R2

You are connected to R1 (192.0.2.1/24, management IP). The network team needs to automate interface configuration using RESTCONF. Construct a valid RESTCONF GET request to retrieve the operational status of GigabitEthernet0/1 using the ietf-interfaces YANG module, and a PATCH request to set the description of that interface to 'Link to R2' using the Cisco-IOS-XE-native YANG module. Identify the error that occurs if the Accept header is set to application/json instead of application/yang-data+json.

Question 1hardConfiguration
Read the full REST/YANG explanation →

Exhibit

R1#show running-config | section interface GigabitEthernet0/1
interface GigabitEthernet0/1
 ip address 10.0.0.1 255.255.255.252
 duplex auto
 speed auto
 media-type rj45
!

R1#show ip interface brief
Interface              IP-Address      OK? Method Status                Protocol
GigabitEthernet0/0     192.0.2.1       YES NVRAM  up                    up      
GigabitEthernet0/1     10.0.0.1        YES NVRAM  up                    up      
Loopback0              203.0.113.1     YES NVRAM  up                    up

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 server returns a 406 Not Acceptable error because RESTCONF requires the Accept header to be 'application/yang-data+json'.

The correct base URI for RESTCONF on Cisco IOS-XE is https://<device-ip>/restconf/data. For the ietf-interfaces module, the YANG path is /ietf-interfaces:interfaces/interface=GigabitEthernet0%2F1 (note the percent-encoded slash in the key). For the Cisco-IOS-XE-native module, the path is /Cisco-IOS-XE-native:native/interface/GigabitEthernet=0%2F1/description. The Accept header must be 'application/yang-data+json'; using 'application/json' returns a 406 Not Acceptable error. The PATCH request body must contain the new description in JSON format. Failing to percent-encode the interface name will result in an invalid URI.

Key principle: NAT direction and interface roles matter as much as the IP address mapping. Inside/outside designation controls which traffic is translated.

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 server returns a 406 Not Acceptable error because RESTCONF requires the Accept header to be 'application/yang-data+json'.

    Why this is correct

    RESTCONF uses the media type 'application/yang-data+json' for JSON encoding. Setting Accept to 'application/json' violates the RESTCONF specification, causing the server to respond with a 406 Not Acceptable error.

    Related concept

    Static NAT maps one inside address to one outside address.

  • The server returns a 400 Bad Request error because the Accept header must be 'application/json' for RESTCONF.

    Why it's wrong here

    This is incorrect because RESTCONF does not use 'application/json' as the standard media type; it uses 'application/yang-data+json'. A 400 error indicates a malformed request, not a content negotiation issue.

  • The server returns a 415 Unsupported Media Type error because the Accept header is set incorrectly.

    Why it's wrong here

    This is incorrect because 415 Unsupported Media Type is used when the Content-Type (request body format) is unsupported, not the Accept header. The Accept header issue results in a 406 error.

  • The server returns a 200 OK response but ignores the Accept header and returns data in XML format.

    Why it's wrong here

    This is incorrect because RESTCONF servers enforce content negotiation; an invalid Accept header results in an error, not a fallback to XML. The server will not ignore the header.

Option-by-option analysis

Why each answer is right or wrong

Understanding why wrong answers are wrong — and when they would be correct — is what separates a 750 score from a 900. The 200-301 exam frequently reuses these exact scenarios with slightly different constraints.

The server returns a 406 Not Acceptable error because RESTCONF requires the Accept header to be 'application/yang-data+json'.Correct answer

Why this is correct

RESTCONF uses the media type 'application/yang-data+json' for JSON encoding. Setting Accept to 'application/json' violates the RESTCONF specification, causing the server to respond with a 406 Not Acceptable error.

The server returns a 400 Bad Request error because the Accept header must be 'application/json' for RESTCONF.Wrong answer — click to see why

Why this is wrong here

The specific factual error: RESTCONF requires 'application/yang-data+json', not 'application/json'.

Why candidates choose this

Candidates might think 'application/json' is acceptable because JSON is commonly used, but RESTCONF mandates a specific media type.

The server returns a 415 Unsupported Media Type error because the Accept header is set incorrectly.Wrong answer — click to see why

Why this is wrong here

The specific factual error: 415 relates to Content-Type, not Accept. Accept errors yield 406.

Why candidates choose this

Candidates may confuse Accept and Content-Type headers, thinking both cause 415 errors.

The server returns a 200 OK response but ignores the Accept header and returns data in XML format.Wrong answer — click to see why

Why this is wrong here

The specific factual error: RESTCONF does not silently fall back; it returns a 406 error.

Why candidates choose this

Candidates might assume the server is lenient and will respond with a default format, but RESTCONF is strict about media types.

Analysis generated from the official 200-301blueprint and verified against question context. The “when correct” sections are what AI assistants cite when candidates ask “what’s the difference between these options?”

Common exam traps

Common exam trap: NAT rules depend on direction and matching traffic

NAT is not only about the public address. The inside/outside interface roles and the ACL or rule that matches traffic are just as important.

Detailed technical explanation

How to think about this question

NAT questions usually test address translation, overload/PAT behaviour, static mappings and whether the right traffic is being translated. Read the interface direction and address terms carefully.

KKey Concepts to Remember

  • Static NAT maps one inside address to one outside address.
  • PAT allows many inside hosts to share one public address using ports.
  • Inside local and inside global describe the private and translated addresses.
  • NAT ACLs identify traffic for translation, not always security filtering.

TExam Day Tips

  • Identify inside and outside interfaces first.
  • Check whether the scenario needs static NAT, dynamic NAT or PAT.
  • Do not confuse NAT matching ACLs with normal packet-filtering intent.

Key takeaway

NAT direction and interface roles matter as much as the IP address mapping. Inside/outside designation controls which traffic is translated.

Real-world example

How this comes up in practice

A small business has 20 workstations on the 192.168.1.0/24 network and one public IP from its ISP. The router uses PAT (NAT overload) so all 20 devices share one public address using different source ports. NAT questions test whether you understand the four address terms and which direction each translation applies.

What to study next

Got this wrong? Here's your next step.

Review the four NAT address types (inside local, inside global, outside local, outside global), PAT port overload, and static vs dynamic NAT use cases. Then practise related 200-301 NAT questions on configuration and troubleshooting.

Related practice questions

Related 200-301 practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free 200-301 practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this 200-301 question test?

AI and Network Operations — This question tests AI and Network Operations — Static NAT maps one inside address to one outside address..

What is the correct answer to this question?

The correct answer is: The server returns a 406 Not Acceptable error because RESTCONF requires the Accept header to be 'application/yang-data+json'. — The correct base URI for RESTCONF on Cisco IOS-XE is https://<device-ip>/restconf/data. For the ietf-interfaces module, the YANG path is /ietf-interfaces:interfaces/interface=GigabitEthernet0%2F1 (note the percent-encoded slash in the key). For the Cisco-IOS-XE-native module, the path is /Cisco-IOS-XE-native:native/interface/GigabitEthernet=0%2F1/description. The Accept header must be 'application/yang-data+json'; using 'application/json' returns a 406 Not Acceptable error. The PATCH request body must contain the new description in JSON format. Failing to percent-encode the interface name will result in an invalid URI.

What should I do if I get this 200-301 question wrong?

Review the four NAT address types (inside local, inside global, outside local, outside global), PAT port overload, and static vs dynamic NAT use cases. Then practise related 200-301 NAT questions on configuration and troubleshooting.

What is the key concept behind this question?

Static NAT maps one inside address to one outside address.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jun 6, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This 200-301 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 200-301 exam.