Postman is a service that facilitates experimentation, documentation and integration of all things API. This is especially useful when trying to learn a new API, giving a relatively simple interface to make and record requests.
It allows for adhoc definitions, or importing pre-existing API specifications in various formats. OpenAPI and WSDL being a couple of examples.
On the experimentation side, it has a unique feature centred around quickly building mock implementations of an API and making them publicly accessible, so that you can test an application against the API before it actually exists.
Follow these steps in order to set the stage for the rest of the demo.
- Install the latest Node.js LTS if you don't already have it.
- Clone this repository.
- Run
npm install
followed bynpm start
from the ui directory. - Open/Load Postman.
- Home -> Start Something New -> Workspace
- Set Name to Demo -> Create Workspace
- APIs -> Create an API -> Import -> GitHub -> Continue
- Set Repository to postman-demo -> Continue -> Import -> Confirm and Close
- APIs -> Backend API -> Develop -> Add Mock Server -> Create New Mock Server -> Use an Existing Collection -> Select Collection and Continue
- Set Name to Demo, Check Save the mock server URL... -> Create Mock Server -> Close
- Environments -> Demo -> Set Variable to baseUrl -> Save
These steps show off a high level overview of Postman's documentation capabilities.
- Workspaces -> Demo -> APIs -> Backend API -> Define
- Develop -> Documentation
- View Collection -> Collections
This is an example of how to run requests and see them in action.
- Workspaces -> Demo -> Collections -> Backend API
- Change No Environment to Demo
- Backend API -> Login -> Invalid credentials -> Set password to bad -> Save
- Send Login request with password set to secret and bad.
- Send Retrieve Logins request.
- Console and observe entries.
- History and observe entries.
Finally, here is a live example of an application speaking to a mocked out API.
- Workspaces -> Demo -> Mock Servers -> Demo -> Copy URL
- Go to UI -> Paste URL
- Set Username to john and password to secret -> Login
- Logout -> Set Username to john and password to bad -> Login
- Go to Postman -> Mock Servers -> Demo
- Observe entries.