Technical requirements
It is recommended that you have a basic understanding of how YANG and NETCONF work before diving into this chapter. For an introduction to both topics, please refer to the Revisiting NETCONF and YANG modules recipe in Chapter 5, Model-Driven Programmability with NETCONF and ncclient.
Since RESTCONF is built on top of HTTP requests, we will need the ability to make HTTP requests with Python. While we could implement the HTTP protocol ourselves or use one of the low-level modules that come with the Python standard library to perform these requests, the Python community has developed a package called requests
that makes dealing with HTTP requests and responses much easier. Under the slogan HTTP for Humans™, this has abstracted most of the difficult tasks of dealing with HTTP on top of the standard library and has become the de facto standard for consuming HTTP-based resources from Python. We'll be using requests
for this chapter as well as for Chapter...