Installing the Requests library
We stated before that Python mainly aims at simplicity and code readability, but, unfortunately, this is not always the case. Interacting with REST using the standard Python libraries can be painfully laborious. Luckily, an open source project can solve this. The project produced a library called Requests, and I have to say it really is an appropriate name. So, let's install it:
- The easiest way to install requests is using pip. If you are running a Python release higher than 2.7.9, pip is already included. We will cover the installation steps in case you have an older release. On Linux, the best approach is using your distribution's package manager:
$ sudo apt-get install python-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
python-pip-whl
...
Do you want to continue? [Y/n] y
Setting up python-pip (8.1...