On this page , I will show you a very easy way how to create a Python program to call the REST service we saw on the previous page .
Let's suppose I still have my Postman interface open and have successfully executed a POST request to the Airport Lookup service.
The nice thing is, that Postman can automatically generate the base code for me. All I have to do, is click on the 'code' icon (see red box)
All I have to do now is select the Programming language I wish from the dropdown (see red box) and below I will get my code snippet.
An easy way to test this code is by using a Google Colab notebook -
Just open the page, hit the 'New notebook' button and paste the code Postman generated into the first cell, and then press the arrow button.
Easy, no?
This is the output I get :