200-901 · Question #281
200-901 Question #281: Real Exam Question with Answer & Explanation
The correct answer is A: {'Content-Type': 'application/yang.data+xml', 'Accept': 'application/yang.data +xml'}. RESTCONF requires the media type application/yang.data+xml for XML-encoded YANG data, which must be specified in both the Content-Type and Accept headers.
Question
Refer to the exhibit. A network engineer wants to use an API to update information about device interfaces. The network devices are deployed in a Cisco DevNet Sandbox and have running interfaces. Which line of code needs to be placed in the snippet where the code is missing?
Options
- A{'Content-Type': 'application/yang.data+xml', 'Accept': 'application/yang.data +xml'}
- B{'Content-Type': 'application/yang.data+yaml', 'Accept': 'application/yang.data +yaml'}
- C{'Content-Type': 'application/restconf.data+json', 'Accept': 'application/ restconf.data+json'}
- D{'Content-Type': 'application/yang.data+utf8', 'Accept': 'application/ restconf.data+utf8'}
Explanation
RESTCONF requires the media type application/yang.data+xml for XML-encoded YANG data, which must be specified in both the Content-Type and Accept headers.
Common mistakes.
- B. YAML is not a recognized media type in the RESTCONF specification (RFC 8040); only JSON and XML encodings are defined for YANG data.
- C. The correct MIME type prefix is application/yang.data, not application/restconf.data; the latter is not a valid RESTCONF media type.
- D. application/yang.data+utf8 is not a defined RESTCONF media type; UTF-8 describes a character encoding, not a data serialization format.
Concept tested. RESTCONF YANG data media types for API headers
Reference. https://www.rfc-editor.org/rfc/rfc8040#section-7.1
Topics
Community Discussion
No community discussion yet for this question.