Postman is the tool developed in 2012 for Chrome, Windows, Mac, and Linux that is used by developer to build a superfast and smooth workflow for API development. Postman is the very fast and light weighted application which is made for different kind of requests like GET, POST, PUT, PATCH and DELETE methods which is very good and convenient API tool.
While APIs get connected to entities by itself, the data that flows from providers to consumers or vice versa is not regular in API, so for this reason Postman is used for regularity in functioning.
Postman is one of the tool which can be used by developers with most efficient feature ie (REpresentational State Transfer) that helps to send API requests and to develop requests faster, while this tool also have a Save functionality which helps to save the API requests, so that one can change parameters and send them again.
How to Use Postman to Manage and Execute Your APIs:
Postman is very simple to use and is straightforward
(Steps should be followed)
l Enter request URL and select the method(action)
Postman is very simple to use and is straightforward
(Steps should be followed)
1. Go to your Chrome browser’s App page (chrome://apps/) and select the postman logo.
2. The postman Gui will be seen along with the feild to enter your API’s request as well as methods menu(GET, PUT, POST, PATCH, DELETE etc)and tabs to enter pre-request scripts, body, headers and authorization credentials
Here is the detailed explanation how to enter the new API request.
l Enter request URL and select the method(action)
l Add authorization tokens and credentials according to the requirements of the server side
l If required, enter the headers
l Enter the body part if required (ex in the post and put method)
3. Requests and Collections-Requests can be store by save button and send by Send button, as you can see the example and screenshot below I have posted, where I have requested http://localhost:50794/api/Cardetails that means I am retrieving all details by get method. Now you can store the requests and can also browse your collections and can recall all requests stored in them from the collections tab on the left side of the window.
E.G
// GET: api/CarDetails
[HttpGet]
public IEnumerable<CarDTO> GetAllcarDetails()
{
CarDatabaseEf db = new CarDatabaseEf();
var list = db.Cardto.ToList();
return list
}
}
Postman in the API Lifecycle:
From last few years, it has been seen the massive shift to API landscape with much greater focus. This turns the whole concept of API life cycle from designing internal API, Then testing of them, documentation etc. postman can be used in different stages of API life cycle as explained below
During design and implementation of the API, Postman can be used at the same time with their IDE to write code and send test requests for teams and for developers. Requests can be packed in form of a package after manual API testing.
As when any project starts in which code is done first and then testing is performed and documentation is done later by other persons, so by using API in postman, the same person can test and can build lists of their test cases, then they can document API manually. Testers and technical writers can use postman’s important feature to load the Open API definition (ie. generated by the developers from their code)and can build out the descriptions and optimize the generated specification.
Conclusion:
In this way, you can use postman tool for developing and for testing your API’s with the different methods available(get, put, post, delete and etc) and can save the requests also. Hope by this blog beginners will get the knowledge of postman and its use to test API’s.
About Author:
V Divya kumari is a consultant in Systems Plus Pvt. Ltd. Within Systems Plus, she actively contributes to the areas of Technology and Information Security. She can be contacted at: divya.kumari@spluspl.com