nerdexam
Cisco

300-435 · Question #44

Refer to the exhibit. An engineer creates a Python script using RESTCONF to display hostname information. The code must be completed so that it can be tested. Which string completes the highlighted…

The correct answer is A. yang-data+json. When using RESTCONF to exchange YANG-modeled data encoded in JSON, the Content-Type header must be set to application/yang-data+json to correctly specify the data format.

Network Automation Foundation

Question

Refer to the exhibit. An engineer creates a Python script using RESTCONF to display hostname information. The code must be completed so that it can be tested. Which string completes the highlighted areas in the exhibit?

Options

  • Ayang-data+json
  • Byang+json
  • Cyang.data+json
  • Djson

How the community answered

(59 responses)
  • A
    92% (54)
  • B
    5% (3)
  • C
    2% (1)
  • D
    2% (1)

Why each option

When using RESTCONF to exchange YANG-modeled data encoded in JSON, the `Content-Type` header must be set to `application/yang-data+json` to correctly specify the data format.

Ayang-data+jsonCorrect

RESTCONF mandates the use of `application/yang-data+json` in the `Content-Type` and `Accept` headers when exchanging YANG-modeled data that is encoded in JSON. This specific content type clearly indicates that the payload adheres to the YANG data structure within a JSON format.

Byang+json

`yang+json` is an incorrect or non-standard media type for RESTCONF; the correct media type for YANG-modeled data in JSON is `yang-data+json`.

Cyang.data+json

`yang.data+json` uses a period instead of a hyphen, making it an incorrect media type and therefore not recognized by RESTCONF.

Djson

`json` is too generic as a media type. While the data is indeed JSON, RESTCONF requires the more specific `yang-data+json` to explicitly identify the payload as YANG-modeled data.

Concept tested: RESTCONF Content-Type for YANG data

Source: https://www.rfc-editor.org/rfc/rfc8040#section-12.2

Topics

#RESTCONF#HTTP Headers#YANG

Community Discussion

No community discussion yet for this question.

Full 300-435 Practice