nerdexam
Cisco

200-901 · Question #331

Refer to the exhibit. Which RESTCONF request results in this response? A. B. C. D.

The correct answer is D. POST /restconf/data/example-jukebox:jukebox/library HTTP/1.1 Host: example.com Content-type: application/yang-data+json { "example-jukebox:dogbreed": [ { "name" : "Australian Cattle Dog" } ] }. The exhibit displays a JSON data structure representing a dogbreed entry, which would typically be the representation of a resource that was successfully created on the server.

Understanding and Using APIs

Question

Refer to the exhibit. Which RESTCONF request results in this response? A. B. C. D.

Exhibits

200-901 question #331 exhibit 1
200-901 question #331 exhibit 2
200-901 question #331 exhibit 3
200-901 question #331 exhibit 4
200-901 question #331 exhibit 5

Options

  • AGET /restconf/data/example-jukebox:jukebox/library HTTP/1.1 Host: example.com Content-type: application/yang-data+json { "example-jukebox:dogbreed": [ { "name" : "Australian Cattle Dog" } ] }
  • BCONFIG /restconf/data/example-jukebox:jukebox/library HTTP/1.1 Host: example.com Content-type: application/yang-data+json { "example-jukebox:dogbreed": [ { "name" : "Australian Cattle Dog" } ] }
  • CPUT /restconf/data/example-jukebox:jukebox/library HTTP/1.1 Host: example.com Content-type: application/yang-data+json { "example-jukebox:dogbreed": [ { "name" : "Australian Cattle Dog" } ] }
  • DPOST /restconf/data/example-jukebox:jukebox/library HTTP/1.1 Host: example.com Content-type: application/yang-data+json { "example-jukebox:dogbreed": [ { "name" : "Australian Cattle Dog" } ] }

How the community answered

(26 responses)
  • A
    4% (1)
  • B
    15% (4)
  • C
    4% (1)
  • D
    77% (20)

Why each option

The exhibit displays a JSON data structure representing a `dogbreed` entry, which would typically be the representation of a resource that was successfully created on the server.

AGET /restconf/data/example-jukebox:jukebox/library HTTP/1.1 Host: example.com Content-type: application/yang-data+json { "example-jukebox:dogbreed": [ { "name" : "Australian Cattle Dog" } ] }

A GET request is used for retrieving existing data and typically does not include a request body.

BCONFIG /restconf/data/example-jukebox:jukebox/library HTTP/1.1 Host: example.com Content-type: application/yang-data+json { "example-jukebox:dogbreed": [ { "name" : "Australian Cattle Dog" } ] }

CONFIG is not a standard HTTP method used in RESTCONF for data manipulation.

CPUT /restconf/data/example-jukebox:jukebox/library HTTP/1.1 Host: example.com Content-type: application/yang-data+json { "example-jukebox:dogbreed": [ { "name" : "Australian Cattle Dog" } ] }

A PUT request is used to either create a resource at a specified URI or replace an existing resource, but POST is generally preferred for adding new items to collections where the server assigns the identifier.

DPOST /restconf/data/example-jukebox:jukebox/library HTTP/1.1 Host: example.com Content-type: application/yang-data+json { "example-jukebox:dogbreed": [ { "name" : "Australian Cattle Dog" } ] }Correct

A POST request is used in RESTCONF to create a new data resource on the server. When the request body contains the data for a new entry (such as the `example-jukebox:dogbreed` entry in this case) and it is sent to a collection's URL (like `/restconf/data/example-jukebox:jukebox/library`), a successful operation results in the creation of that resource, and its representation can be returned as the response body.

Concept tested: RESTCONF POST method for resource creation

Source: https://datatracker.ietf.org/doc/html/rfc8040#section-3.5.2

Topics

#RESTCONF#API Requests#HTTP Methods#Network Automation

Community Discussion

No community discussion yet for this question.

Full 200-901 Practice