Skip to content

Create a web server using flask and test for API requests using postman

Notifications You must be signed in to change notification settings

Alpha-github/rest_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

#Project 3: REST API

 

PostmanPython Flask

Description

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.

Technology

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.

Setup

This was build on Windows 8.1.

These were the pre-requisities :

### Install Postman Native Application:

Step 1: To install Postman, go to the this link and click Download for Mac / Windows / Linux depending on your platform.

Install PostMan Home Page

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.

Install Postman Choose Windows Version

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.

Postman Download Native App

Installing Postman

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.

You will need Python 3.6+ to run.

Click the python thumbnail to go to Python Download Page

Click to go to Python Download Page

Download

$ git clone https://github.com/Alpha-github/rest_api.git

Important !! :

  • Give input through Postman, in the form of JSON to avoid exceptions (error) during execution of code

License

Public

About

Create a web server using flask and test for API requests using postman

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages