Courseiva
Automation →mediumMultiple Choice

350-401 Automation Practice Question

A network engineer is building a Python script to configure a Cisco IOS XE device via RESTCONF. The script sends a POST request to the URI https://10.1.1.1/restconf/data/ietf-interfaces:interfaces with the JSON payload shown. The device returns HTTP 415 Unsupported Media Type. Which change to the script will resolve the error?

⚠ Common exam trap

Many exam-takers confuse the Accept header (which specifies the desired response format) with the Content-Type header (which specifies the format of the request body).

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 the header 'Content-Type: application/yang-data+json' to the request.

RESTCONF uses HTTP and requires standard headers to indicate payload format. When sending JSON, the Content-Type header must be set to application/yang-data+json. The server uses this to select the correct parser. Without it, the device returns 415 Unsupported Media Type, indicating it cannot process the body.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Add the header 'Accept: application/yang-data+json' to the request.

    Why it's wrong here

    The Accept header tells the server what response format the client prefers (e.g., JSON). It does not specify the format of the request body. The 415 error is caused by the server rejecting the request payload's media type, so Accept alone will not resolve it. The Content-Type header is needed instead.

  • ✗

    Include authentication credentials in the request body.

    Why it's wrong here

    Authentication is typically handled via HTTP Basic Auth headers or tokens, not in the body. Even if authentication were missing, the server would return 401 Unauthorized, not 415. The 415 status specifically indicates an unsupported media type, so adding credentials to the body would not address the root cause.

  • ✗

    Change the HTTP method from POST to PUT.

    Why it's wrong here

    Changing to PUT would not fix the 415 error because the server still cannot interpret the payload without the correct Content-Type header. PUT is used to replace a resource, while POST creates one; the method choice does not address the media type issue. The error is about payload format, not method.

  • ✓

    Add the header 'Content-Type: application/yang-data+json' to the request.

    Why this is correct

    RESTCONF requires the Content-Type header to be application/yang-data+json when sending a JSON payload. Without it, the device cannot determine the payload format and returns 415. Adding this header tells the server the body is YANG data encoded in JSON, allowing it to parse and apply the configuration.

Visual reference

Client Recursive Resolver Root DNS (13 root servers) TLD DNS (.com, .org, …) Authoritative example.com query IP addr answer

Go deeper

Related to this question

About these practice questions

This 350-401 question is part of Courseiva's 1,923-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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.