Using the REST API with Python

Python is one of many programming languages that is widely used for automating networks. There is no built-in REST or HTTP client in Python, but Python allows importing libraries, functions, modules, or frameworks. One of the libraries that can be used to send HTTP REST API requests is the requests library—an Apache2 Licensed HTTP library written in Python. In this recipe, we will import and leverage the requests library to perform a REST API call to NSX in Python version 2.7.

Get VMware NSX Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.