nerdexam
Cisco

200-901 · Question #450

Refer to the exhibit. A developer is trying to collect data over RESTCONF API and prepares the request. The developer wants to get data in JSON format and with the IOS-XE-native model, but the…

The correct answer is B. invalid URL. A RESTCONF API request for IOS-XE-native model data fails because the URL does not correctly reference the YANG module path and RESTCONF base URI required by the IOS-XE device.

Understanding and Using APIs

Question

Refer to the exhibit. A developer is trying to collect data over RESTCONF API and prepares the request. The developer wants to get data in JSON format and with the IOS-XE-native model, but the request fails. Which HTTP part causes the failure?

Exhibit

200-901 question #450 exhibit

Options

  • Aapplication value
  • Binvalid URL
  • Cmissing URI header path
  • Dincorrect request type

How the community answered

(38 responses)
  • A
    8% (3)
  • B
    71% (27)
  • C
    5% (2)
  • D
    16% (6)

Why each option

A RESTCONF API request for IOS-XE-native model data fails because the URL does not correctly reference the YANG module path and RESTCONF base URI required by the IOS-XE device.

Aapplication value

The Accept header value (application/yang-data+json) correctly requests JSON-formatted YANG data and is not the cause of the failure when the URL is malformed.

Binvalid URLCorrect

For RESTCONF on IOS-XE, the URL must precisely follow the pattern '/restconf/data/Cisco-IOS-XE-native:native' using the exact YANG module name registered on the device. An incorrect module name, wrong path segment, or malformed base URI causes the RESTCONF server to return an error because it cannot resolve the target resource. Even if the headers and request method are correct, an invalid URL alone is sufficient to cause the request to fail.

Cmissing URI header path

RESTCONF does not use a separate 'URI header path' - the resource path is part of the URL itself, and this is not a recognized HTTP or RESTCONF failure category.

Dincorrect request type

GET is the correct HTTP method for retrieving RESTCONF data resources and is not the source of failure when the URL itself is invalid.

Concept tested: RESTCONF API URL structure for Cisco IOS-XE YANG model

Source: https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/prog/configuration/166/b_166_programmability_cg/restconf_programmable_interface.html

Topics

#RESTCONF#YANG models#API requests#URL structure

Community Discussion

No community discussion yet for this question.

Full 200-901 Practice