Choose an Appropriate Library
Explore the criteria for selecting an appropriate Python library to consume REST APIs effectively. Understand the differences between low-level and high-level HTTP libraries, and discover why the requests library suits most needs for both simple and configurable API consumption.
We'll cover the following...
Before we start creating a client to consume REST services, we need to select the Python library that we’re going to use.
First of all, we need to define what we need the library to do. Then, after looking at the available Python libraries, we’ll be able to select the best match for our requirements. So, let’s first specify the selection criteria.
Our criteria
There are many libraries in every language that can be used to access a service, ranging from low-level
- It should abstract out the low-level connection details.
- It should allow us to directly access/use the lower HTTP layers if required.
- If point 2 isn’t possible, then the library should at least let