REST: Representational State Transfer (REST) is a software architectural style that defines a set of constraints to be used for creating Representational State Transfer (REST) is a software architectural style that defines a set of constraints to be used for creating Web services and Web APIs. API: In computer programming, Programming Interface which allows software applications to communicate with each other via API calls. An application programming interface is a set of subroutine definitions, communication protocols, and tools for building software.
This project uses a flask server programmed in python, to make API calls (GET, POST, PUT, DELETE, PATCH, etc) and test them using Postman. The server uses REST architecture for requests made by and responses to, the client. Most Web browsers by default serve for GET request. However to test other requests, another API called Postman is used.
Generally a server contains a database which contains information required by the client. However in this project a JSON file containing some information is used as a database.
These are the following packages, tools and platforms used in this project:
-
Flask -Flask is a microframework for Python based on Werkzeug, Jinja 2 and good intentions
-
Python - It is a popular, easy to pick up programming language and fun to play with.
-
Postman - Postman is currently one of the most popular tools used in API testing.
-
JSON - It is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate.
These were the pre-requisities :
Step 1: To install Postman, go to the this link and click Download for Mac / Windows / Linux depending on your platform.
Here I am going to download Windows 64 bit version, since I have Windows 64 bit machine. If you have Windows 32 bit machine, you can download Postman for Windows 32 bit as shown in the below image.
Once it is downloaded, you can find your downloaded file in the default downloads location of your system. If you are using Chrome browser, the downloaded file will appear at the bottom of the browser as shown in the below image.
Step 2: Open Postman windows 64 bit exe file to install it on your system.
Step 3: Once installation of Postman is completed, you will be asked to create an account. You can create an account later time by clicking on “Take me straight to the app, I’ll create an account another time” link.
Click the python thumbnail to go to Python Download Page
$ git clone https://github.com/Alpha-github/rest_api.git
- Give input through Postman, in the form of JSON to avoid exceptions (error) during execution of code