Postman is an excellent tool for all kinds of developers. Here are 10 useful Postman tips and features of this swiss army knife.
1. Workspace
You can create multiple workspaces to isolate all collections, environments, etc.
There are three different kinds of Postman workspaces for your different needs: personal workspaces, team workspaces, and public workspaces.
2. Environments and variables
An environment is a set of variables you can use in your Postman requests. You can use environments to group related sets of values together and manage access to shared Postman data if you are working as part of a team.
Create your environment (like local, test, pre-prod) variables in the Environments tab, then use them in your requests.
Define variables
Choose active environment
3. Running scripts
Suppose you have a login API to get a token. Then use this token in all your requests. You can create a test script and save tokens as environment variables. Now your token variable is updated after each successful login request.
Parse and set token from login response
You can also run scripts before each request with *Pre-request Scripts
*
4. Inherit Authorization
Click the collection, select an authorization type from the Authorization tab. Fill in the requested fields.
Choose Inherit auth from parent option for your request. Authorization is done for all your request.
5. Run Automated Tests
Create assertion scripts (HTTP status code, response objects for all your request. Here is an example test to check if HTTP status code is 200 and the response JSON has userId:1 field.
6. Examples
Examples show your API endpoints in action and provide additional details on exactly how requests and responses work. You can add an example to a request by saving a response, or you can create an example with a custom response to illustrate a specific use case.
7. Monitors
Postman Monitors give you continuous visibility into the health and performance of your APIs. Uptime monitors (open beta) enable you to keep watch on a single API endpoint, while collection-based monitors enable you to run API test scripts, chain together multiple requests, and validate critical API flows.
8. Visualize Responses
The Postman Visualizer provides a programmable way to visually represent your request responses. Visualization code added to the Tests for a request will render in the Visualize tab for the response body, alongside the Pretty, Raw, and Preview options.
9. Share Collections
You can share your work with others by sharing
- directly to emails
- Run in Postman
- Via JSON link
10. Flows
You can use Flows to chain requests, handle data and create real-world workflows right in your Postman workspace. Flows help you create API workflows by connecting a series of requests through a drag-and-drop UI.
Top comments (0)