nerdexam
Cisco

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.

Understanding and Using APIs

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

200-901 question #301 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)
  • A
    4% (1)
  • B
    85% (23)
  • C
    7% (2)
  • D
    4% (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.

A{'Content-Type': 'application/yang.data+yaml',

`application/yang.data+yaml` specifies YAML as the serialization format, which, while possible, is less common for network automation APIs compared to JSON.

B{'Content-Type': 'application/yang.data+json',Correct

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.

C{'Content-Type': 'application/yang.data+utf8l',

`application/yang.data+utf8l` is not a standard or recognized media type for representing YANG data in an API context.

D{'Content-Type': 'application/restconf.data+txt',

`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

#API Headers#Content-Type#RESTCONF#JSON

Community Discussion

No community discussion yet for this question.

Full 200-901 Practice