To create a new "artist" resource within the "library" resource, the client might send the following JSON encoded request.
Note: the Content-Type must be set to JSON format in order to do edits in JSON encoding
POST /restconf/data/example-jukebox:jukebox/library HTTP/1.1
Host: example.com
Content-Type: application/yang-data+json
{
"example-jukebox:artist" : {
"name" : "Foo Fighters"
}
}
In this example, the client modifies two different data nodes by sending a PATCH to the datastore resource using XML encoding:
PATCH /restconf/data HTTP/1.1
Host: example.com
Content-Type: application/yang-data+xml
<data xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf">
<jukebox xmlns="http://example.com/ns/example-jukebox">
<library>
<artist>
<name>Foo Fighters</name>
<album>
<name>Wasting Light</name>
<year>2011</year>
</album>
</artist>
<artist>
<name>Nick Cave</name>
<album>
<name>Tender Prey</name>
<year>1988</year>
</album>
</artist>
</library>
</jukebox>
</data>