Courseiva
mediumMultiple Choice

350-401 Practice Question: Consider the following Python script that uses…

Consider the following Python script that uses the requests library to delete a VLAN via RESTCONF on a Cisco IOS-XE device:

```python

import requests
from requests.auth import HTTPBasicAuth

url = 'https://192.168.1.1/restconf/data/Cisco-IOS-XE-native:native/vlan=10' headers = { 'Accept': 'application/yang-data+json', 'Content-Type': 'application/yang-data+json'

}

auth = HTTPBasicAuth('admin', 'cisco')

response = requests.delete(url, headers=headers, auth=auth, verify=False)

print(response.status_code)

```

What is the expected outcome if the VLAN 10 exists?

⚠ Common exam trap

Watch out — candidates often confuse HTTP methods, thinking DELETE requires a payload like PUT/POST, or mistakenly believe DELETE can retrieve or create resources, when in fact each HTTP method has a distinct CRUD mapping in RESTCONF.

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

✓

It will delete VLAN 10 from the device configuration.

The `requests.delete()` method sends an HTTP DELETE request to the RESTCONF API endpoint for VLAN 10. When the VLAN exists, the device processes the DELETE operation and removes the VLAN configuration from the running config, returning a 204 No Content status code upon success.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    It will retrieve the configuration of VLAN 10.

    Why it's wrong here

    The HTTP DELETE method removes the target resource; retrieval uses GET against the same URI. The script sets no method other than delete, so no configuration is returned. GET would be correct when the goal is to read VLAN 10's existing configuration rather than remove it.

  • ✗

    It will create VLAN 10 if it does not exist.

    Why it's wrong here

    DELETE removes the addressed resource; it never creates one. Creation happens through POST to the collection URI or PUT to the instance URI, both of which carry a JSON or XML representation. The stem states VLAN 10 already exists, so deletion, not creation, is the operation performed.

  • ✓

    It will delete VLAN 10 from the device configuration.

    Why this is correct

    RESTCONF DELETE against the exact data node URL removes the targeted VLAN instance; with VLAN 10 present, IOS-XE returns 204 No Content and the VLAN is removed from the running configuration. The URL path identifies the list entry, so the operation succeeds.

  • ✗

    It will return an error because the payload is missing.

    Why it's wrong here

    RESTCONF DELETE carries no body by design; the URI itself identifies the resource, so no payload is required and the request succeeds with 204 No Content. A missing payload triggers errors only for POST or PUT, where the representation must be supplied to create or replace the target resource.

Visual reference

Switch VLAN 10 Sales (192.168.10.0/24) PC-A PC-B VLAN 20 HR (192.168.20.0/24) PC-C PC-D Router VLANs isolate traffic — inter-VLAN routing requires a Layer 3 device

Go deeper

Related to this question

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 →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

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.