200-901 · Question #301
Refer to the exhibit. A network engineer wants use API update information about device interfaces. The network devices are deployed in a Cisco DevNet Sandbox and have running interfaces. Which value i
The correct answer is B. {'Content-Type': 'application/yang.data+json',. To update device interfaces using a RESTCONF API in a Cisco DevNet Sandbox, the Content-Type header should specify that the payload is structured data conforming to a YANG model and serialized in JSON format.
Question
Refer to the exhibit. A network engineer wants use API update information about device interfaces. The network devices are deployed in a Cisco DevNet Sandbox and have running interfaces. Which value is suitable as the headers variable?
Exhibit
Options
- A{'Content-Type': 'application/yang.data+yaml',
- B{'Content-Type': 'application/yang.data+json',
- C{'Content-Type': 'application/yang.data+utf8l',
- D{'Content-Type': 'application/restconf.data+txt',
How the community answered
(27 responses)- A4% (1)
- B85% (23)
- C7% (2)
- D4% (1)
Why each option
To update device interfaces using a RESTCONF API in a Cisco DevNet Sandbox, the `Content-Type` header should specify that the payload is structured data conforming to a YANG model and serialized in JSON format.
`application/yang.data+yaml` specifies YAML as the serialization format, which, while possible, is less common for network automation APIs compared to JSON.
RESTCONF APIs, which are commonly used to interact with network devices using YANG data models, typically utilize JSON as the preferred data serialization format. The `application/yang.data+json` media type correctly indicates that the request body contains data structured according to a YANG model and formatted as JSON, making it suitable for programmatic updates.
`application/yang.data+utf8l` is not a standard or recognized media type for representing YANG data in an API context.
`application/restconf.data+txt` specifies plain text, which is not suitable for the structured data required when interacting with YANG models via RESTCONF.
Concept tested: RESTCONF Content-Type headers for YANG data
Source: https://datatracker.ietf.org/doc/html/rfc8040#section-3.5.1
Topics
Community Discussion
No community discussion yet for this question.
