B.1.3. 检索服务器功能信息

在本例中,客户端以XML格式从服务器获取能力信息,服务器支持所有RESTCONF查询参数以及一个供应商参数:

  1. GET /restconf/data/ietf-restconf-monitoring:restconf-state/capabilities HTTP/1.1
  2. Host: example.com
  3. Accept: application/yang-data+xml

服务器可能会如下回应:

  1. HTTP/1.1 200 OK
  2. Date: Thu, 26 Jan 2017 20:56:30 GMT
  3. Server: example-server
  4. Cache-Control: no-cache
  5. Last-Modified: Thu, 26 Jan 2017 16:00:14 GMT
  6. Content-Type: application/yang-data+xml
  7. <capabilities
  8. xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf-monitoring">
  9. <capability>urn:ietf:params:restconf:capability:defaults:1.0?basic-mode=explicit</capability>
  10. <capability>urn:ietf:params:restconf:capability:with-defaults:1.0</capability>
  11. <capability>urn:ietf:params:restconf:capability:depth:1.0</capability>
  12. <capability>urn:ietf:params:restconf:capability:fields:1.0</capability>
  13. <capability>urn:ietf:params:restconf:capability:filter:1.0</capability>
  14. <capability>urn:ietf:params:restconf:capability:start-time:1.0</capability>
  15. <capability>urn:ietf:params:restconf:capability:stop-time:1.0</capability>
  16. <capability>http://example.com/capabilities/myparam</capability>
  17. </capabilities>