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.
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
Options
- Aapplication value
- Binvalid URL
- Cmissing URI header path
- Dincorrect request type
How the community answered
(38 responses)- A8% (3)
- B71% (27)
- C5% (2)
- D16% (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.
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.
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.
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.
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
Community Discussion
No community discussion yet for this question.
