Being able to interact with RESTful APIs based on HTTP is an increasingly common task in projects in any programming language. In Python, we also have the option of interacting with a REST API in a simple way with the Requests module. In this section, we review the different ways in which we can interact with an HTTP-based API using the Python Requests package.
Building an HTTP Client with requests
Introduction to requests
One of the best options within the Python ecosystem for making HTTP requests is a library of third-party requests. You can install the requests library in your system in a easy way with pip command:
pip install requests
This module is available on the PyPi repository as the requests package. It can either...