Courseiva
Automation →hardMultiple Choice

350-401 Automation Practice Question

A network engineer is developing a Python script that uses the requests library to send a RESTCONF PATCH request to a Cisco IOS XE device. The script includes the header 'Content-Type: application/yang-data+json' and sends a JSON payload to update the description of an interface. The device returns HTTP 400 Bad Request. Which is the most likely cause?

⚠ Common exam trap

The trap here is assuming that any JSON is acceptable, when RESTCONF requires strict adherence to the YANG model structure.

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 JSON payload is not formatted according to the YANG model structure for the interface description.

An HTTP 400 Bad Request from a RESTCONF PATCH typically indicates that the request body does not conform to the YANG model structure. The payload must be correctly nested according to the model, such as including the module name and proper containers. The Content-Type is correct for RESTCONF JSON. The PATCH method is supported. Therefore, the most likely cause is a malformed JSON payload that violates the YANG model.

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 PATCH method is not supported by RESTCONF; PUT should be used instead.

    Why it's wrong here

    RESTCONF does support the PATCH method, which is used for partial updates. PUT is used for full replacement. The HTTP 400 error indicates a client-side issue, such as malformed data, not an unsupported method. Therefore, this option is incorrect because PATCH is valid in RESTCONF.

  • ✗

    The Content-Type header should be 'application/json' instead of 'application/yang-data+json'.

    Why it's wrong here

    For RESTCONF with JSON, the correct Content-Type is 'application/yang-data+json'. Using 'application/json' may be accepted by some implementations, but it is not the standard for RESTCONF. The HTTP 400 error is more likely due to payload structure than the Content-Type header. Therefore, this option is not the primary cause.

  • ✓

    The JSON payload is not formatted according to the YANG model structure for the interface description.

    Why this is correct

    RESTCONF requires the payload to conform to the YANG model. If the JSON structure does not match the expected hierarchy, such as missing the 'ietf-interfaces:interface' container or incorrect nesting, the device will reject it with HTTP 400. This is the most likely cause. The engineer must ensure the payload follows the YANG model exactly.

  • ✗

    The device does not support RESTCONF and requires NETCONF for configuration changes.

    Why it's wrong here

    If the device did not support RESTCONF, the connection would likely fail with a different error, such as HTTP 404 or connection refused. An HTTP 400 Bad Request indicates that the server understood the request but found the payload invalid. Thus, lack of RESTCONF support is not the cause here.

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 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.