Courseiva
Automation and AssuranceeasyMultiple ChoiceObjective-mapped

350-501 Automation and Assurance Practice Question

A junior automation engineer is writing a Python script to configure OSPF on a Cisco IOS-XE router using RESTCONF. The script sends a PUT request to update the OSPF configuration but receives a 401 Unauthorized response. The engineer has configured a local user with privilege 15 on the router and enabled restconf. The engineer verified that the router's RESTCONF API is running on port 443. What is the most likely missing element in the script?

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 script must use HTTP basic authentication with the correct username and password.

A 401 Unauthorized response indicates the request lacks proper authentication. The engineer likely forgot to include HTTP basic authentication headers with the correct username and password. Other options relate to content types or TLS, which would cause different errors (e.g., 415 Unsupported Media Type).

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 script must include an Accept header.

    Why it's wrong here

    Missing Accept header might result in a 406 Not Acceptable, not 401.

  • The script must include a Content-Type header set to application/yang-data+json.

    Why it's wrong here

    Missing Content-Type would result in a 415 Unsupported Media Type, not 401.

  • The script must use HTTP basic authentication with the correct username and password.

    Why this is correct

    RESTCONF uses HTTP basic authentication by default; without it, the server returns 401.

  • The script must use HTTPS with a valid certificate.

    Why it's wrong here

    The engineer already verified the API is on port 443, implying HTTPS is used; certificate issues would cause SSL errors, not HTTP 401.

Visual reference

R1 R2 R3 R4 10 100 10 100 OSPF picks R1→R2→R4 (cost 20) over R1→R3→R4 (cost 200)

About these practice questions

Courseiva writes every 350-501 question from scratch — 971 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-501 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-501 exam.