In this section, we will learn how to use the requests library. How we interact with RESTful APIs based on HTTP is an increasingly common task in projects that use the Python programming language.
Consuming web services in Python with requests
Introduction to requests
Requests allow you to send requests to an HTTP server and get responses and messages sent by the server. They're available as the Requests package on PyPI. This can either be installed through pip or be downloaded from http://docs.python-requests.org, which hosts the documentation. You can install the requests library on your system in an easy way with the pip command:
pip install requests
The requests library automates and simplifies many of the tasks that...