B.3.4. “insert”参数

在这个例子中,“Foo-One”播放列表中新的第一首歌曲正在创建。

客户端请求:

  1. POST /restconf/data/example-jukebox:jukebox/playlist=Foo-One?insert=first HTTP/1.1
  2. Host: example.com
  3. Content-Type: application/yang-data+json
  4. {
  5. "example-jukebox:song" : [
  6. {
  7. "index" : 1,
  8. "id" : "/example-jukebox:jukebox/library/artist[name='Foo Fighters']/album[name='Wasting Light']/song[name='Rope']"
  9. }
  10. ]
  11. }

服务器响应:

  1. HTTP/1.1 201 Created
  2. Date: Thu, 26 Jan 2017 20:56:30 GMT
  3. Server: example-server
  4. Last-Modified: Thu, 26 Jan 2017 20:56:30 GMT
  5. Location: https://example.com/restconf/data/example-jukebox:jukebox/playlist=Foo-One/song=1
  6. ETag: "eeeada438af"