ExamGecko
Question list
Search
Search

Question 385 - 200-901 discussion

Report
Export

Refer to the exhibit.

An administrator attempts to perform a GET operation by using the Cisco IOS XE RESTCONF API to return the hostname of a device. The sequence diagram in the exhibit illustrates the HTTP messages observed. Which change to the API request resolves the issue?

A.

Remove the -H 'Accept: application/yang-data+json’ header.

Answers
A.

Remove the -H 'Accept: application/yang-data+json’ header.

B.

Replace -u cisco:cisco parameter with -u ‘cisco:cisco’.

Answers
B.

Replace -u cisco:cisco parameter with -u ‘cisco:cisco’.

C.

Change the request method from -X ‘GET’ to -X ‘POST’.

Answers
C.

Change the request method from -X ‘GET’ to -X ‘POST’.

D.

Add the -H ‘Content-Type: application/yang-data+json’ header.

Answers
D.

Add the -H ‘Content-Type: application/yang-data+json’ header.

Suggested answer: D

Explanation:

The HTTP 401 Unauthorized error indicates that the request lacks proper authenticationcredentials. However, in this case, the credentials are provided, so the issue likely stems from a

missing or incorrect header. The Content-Type header is necessary for many REST APIs tospecify the format of the request body. Adding the Content-Type: application/yang-data+jsonheader ensures that the server correctly interprets the request as JSON formatted dataaccording to the YANG data model.

asked 07/10/2024
Alexey Chernikov
32 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first