- A
The URL is missing the '/data' segment; it should be '/restconf/data/...'
Why wrong: The URL already includes '/restconf/data/'.
- B
The interface name 'GigabitEthernet1/0/1' in the URL must be URL-encoded as 'GigabitEthernet1%2F0%2F1'.
The slash in the interface name must be percent-encoded to avoid being interpreted as a path separator.
- C
The Accept header should be 'application/json' instead of 'application/yang-data+json'.
Why wrong: RESTCONF uses 'application/yang-data+json' for YANG data.
- D
The HTTP method should be POST instead of GET.
Why wrong: GET is correct for retrieving data.
Quick Answer
The most likely issue is that the interface name containing a forward slash, such as GigabitEthernet1/0/1, must be URL-encoded as GigabitEthernet1%2F0%2F1 in the RESTCONF URI. This is because the forward slash is a reserved character in URLs that separates path segments, so when it appears as part of a data node identifier in a RESTCONF path, it must be percent-encoded to prevent the server from misinterpreting it as a directory separator. On the ENCOR 350-401 exam, this tests your understanding of RESTCONF URL construction and the YANG data model hierarchy, specifically how interface names with slashes require encoding to match the module's leaf-list key format. A common trap is assuming the interface name can be used literally, especially when copying from show commands, but the RESTCONF API strictly requires proper encoding for any special characters. Remember the mnemonic: "Slash in the path, encode with %2F to avoid the wrath."
CCNP Python for Network Automation Practice Question
This 350-401 practice question tests your understanding of python for network automation. 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.
A network engineer uses the Requests library to query a Cisco IOS-XE device via RESTCONF for interface statistics:
```python
import requests from requests.auth import HTTPBasicAuth
url = 'https://192.168.1.1/restconf/data/Cisco-IOS-XE-interfaces-oper:interfaces/interface=GigabitEthernet1/statistics' headers = {'Accept': 'application/yang-data+json'} auth = HTTPBasicAuth('admin', 'cisco123') response = requests.get(url, headers=headers, auth=auth, verify=False)
print(response.json())
```
What is the most likely issue with this code?
Clue words in this question
Noticing these words before you look at the options changes how you read each choice.
Clue:
"most likely"Why it matters: Probability qualifier — the question wants the most probable cause or outcome, not a guaranteed one. Eliminate low-probability options.
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 interface name 'GigabitEthernet1/0/1' in the URL must be URL-encoded as 'GigabitEthernet1%2F0%2F1'.
The URL uses 'https://' but the code does not disable SSL certificate verification properly; verify=False is used, but the requests library may still raise an InsecureRequestWarning. More critically, the URL path is incorrect: the interface name should be URL-encoded (e.g., 'GigabitEthernet1' is fine, but the path may need to be 'Cisco-IOS-XE-interfaces-oper:interfaces/interface=GigabitEthernet1/statistics' — however, the module is 'Cisco-IOS-XE-interfaces-oper' and the leaf is 'interface', but the correct YANG path might require a different format. The most common issue is that the interface name must be URL-encoded if it contains special characters, but here it's simple. A more likely issue is that the device may require a specific namespace or the path is missing the 'data' prefix? Actually, the path seems correct. Another common issue: the device may not have RESTCONF enabled or the credentials are wrong. But the most immediate problem is that the code does not handle HTTP errors or check response status, and the 'verify=False' may cause a warning but not failure. However, the question expects a specific bug: the URL should be 'https://192.168.1.1/restconf/data/Cisco-IOS-XE-interfaces-oper:interfaces/interface=GigabitEthernet1/statistics' — but the module name is case-sensitive. The real issue is that the interface name in the URL must be URL-encoded if it contains a slash (e.g., 'GigabitEthernet1/0/1'), but here it's simple. Let me adjust: The typical bug is that the engineer forgot to include the 'data' keyword in the URL. Actually, the URL includes '/restconf/data/', which is correct. Hmm. Let me think of a common mistake: The Accept header should be 'application/yang-data+json' which is correct. Perhaps the issue is that the device uses self-signed certificate and the code does not suppress warnings, but that's not a failure. Another common issue: The interface name in the URL should be URL-encoded, but for 'GigabitEthernet1' it's fine. I'll change the interface to 'GigabitEthernet1/0/1' to introduce a URL encoding bug.
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 URL is missing the '/data' segment; it should be '/restconf/data/...'
Why it's wrong here
The URL already includes '/restconf/data/'.
- ✓
The interface name 'GigabitEthernet1/0/1' in the URL must be URL-encoded as 'GigabitEthernet1%2F0%2F1'.
Why this is correct
The slash in the interface name must be percent-encoded to avoid being interpreted as a path separator.
Clue confirmation
The clue word "most likely" in the question point toward this answer.
Related concept
Static NAT maps one inside address to one outside address.
- ✗
The Accept header should be 'application/json' instead of 'application/yang-data+json'.
Why it's wrong here
RESTCONF uses 'application/yang-data+json' for YANG data.
- ✗
The HTTP method should be POST instead of GET.
Why it's wrong here
GET is correct for retrieving data.
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 350-401 NAT questions on configuration and troubleshooting.
- →
Python for Network Automation — study guide chapter
Learn the concepts, then practise the questions
- →
Python for Network Automation practice questions
Targeted practice on this topic area only
- →
All 350-401 questions
2,015 questions across all exam domains
- →
ENCOR 350-401 study guide
Full concept coverage aligned to exam objectives
- →
350-401 practice test guide
How to use practice tests most effectively before exam day
Related practice questions
Related 350-401 practice-question pages
Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.
Architecture practice questions
Practise 350-401 questions linked to Architecture.
Enterprise Network Design practice questions
Practise 350-401 questions linked to Enterprise Network Design.
SD-Access Architecture practice questions
Practise 350-401 questions linked to SD-Access Architecture.
SD-WAN Architecture practice questions
Practise 350-401 questions linked to SD-WAN Architecture.
QoS Architecture practice questions
Practise 350-401 questions linked to QoS Architecture.
Virtualization practice questions
Practise 350-401 questions linked to Virtualization.
Network Function Virtualization practice questions
Practise 350-401 questions linked to Network Function Virtualization.
Virtual Machines and Hypervisors practice questions
Practise 350-401 questions linked to Virtual Machines and Hypervisors.
VRF and Path Isolation practice questions
Practise 350-401 questions linked to VRF and Path Isolation.
Infrastructure practice questions
Practise 350-401 questions linked to Infrastructure.
OSPF practice questions
Practise 350-401 questions linked to OSPF.
BGP practice questions
Practise 350-401 questions linked to BGP.
Practice this exam
Start a free 350-401 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 350-401 question test?
Python for Network Automation — This question tests Python for Network Automation — Static NAT maps one inside address to one outside address..
What is the correct answer to this question?
The correct answer is: The interface name 'GigabitEthernet1/0/1' in the URL must be URL-encoded as 'GigabitEthernet1%2F0%2F1'. — The URL uses 'https://' but the code does not disable SSL certificate verification properly; verify=False is used, but the requests library may still raise an InsecureRequestWarning. More critically, the URL path is incorrect: the interface name should be URL-encoded (e.g., 'GigabitEthernet1' is fine, but the path may need to be 'Cisco-IOS-XE-interfaces-oper:interfaces/interface=GigabitEthernet1/statistics' — however, the module is 'Cisco-IOS-XE-interfaces-oper' and the leaf is 'interface', but the correct YANG path might require a different format. The most common issue is that the interface name must be URL-encoded if it contains special characters, but here it's simple. A more likely issue is that the device may require a specific namespace or the path is missing the 'data' prefix? Actually, the path seems correct. Another common issue: the device may not have RESTCONF enabled or the credentials are wrong. But the most immediate problem is that the code does not handle HTTP errors or check response status, and the 'verify=False' may cause a warning but not failure. However, the question expects a specific bug: the URL should be 'https://192.168.1.1/restconf/data/Cisco-IOS-XE-interfaces-oper:interfaces/interface=GigabitEthernet1/statistics' — but the module name is case-sensitive. The real issue is that the interface name in the URL must be URL-encoded if it contains a slash (e.g., 'GigabitEthernet1/0/1'), but here it's simple. Let me adjust: The typical bug is that the engineer forgot to include the 'data' keyword in the URL. Actually, the URL includes '/restconf/data/', which is correct. Hmm. Let me think of a common mistake: The Accept header should be 'application/yang-data+json' which is correct. Perhaps the issue is that the device uses self-signed certificate and the code does not suppress warnings, but that's not a failure. Another common issue: The interface name in the URL should be URL-encoded, but for 'GigabitEthernet1' it's fine. I'll change the interface to 'GigabitEthernet1/0/1' to introduce a URL encoding bug.
What should I do if I get this 350-401 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 350-401 NAT questions on configuration and troubleshooting.
Are there clue words in this question I should notice?
Yes — watch for: "most likely". Probability qualifier — the question wants the most probable cause or outcome, not a guaranteed one. Eliminate low-probability options.
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 →
Last reviewed: Jun 18, 2026
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.
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.
Sign in to join the discussion.