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.
Question
Refer to the exhibit. Which RESTCONF request results in this response? A. B. C. D.
Exhibits
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)- A4% (1)
- B15% (4)
- C4% (1)
- D77% (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.
A GET request is used for retrieving existing data and typically does not include a request body.
CONFIG is not a standard HTTP method used in RESTCONF for data manipulation.
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.
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
Community Discussion
No community discussion yet for this question.




