Testing web services or APIs is critical but it can be cumbersome, since you often need to look at the raw data to get a feel for what is happening with requests and responses, along with the service not having a user interface. In the past I used the soapUI to work with web services, but I recently stumbled upon Postman which brings powerful testing options to the Chrome environment.
Delivers a powerful web client
Postman is available via its website, or it can be installed as a Chrome add-on (or package). The packaged version comes with more options, including OAuth authentication.
I chose to install the packaged application, which is available from the Chrome Web Store (Figure A). During installation, you’ll be warned that Postman will access your local computer and other websites (Figure B). Once installed, you may pin it to the task bar in Windows or your operating system (the Chrome App Launcher may be used as well, as in Figure C).
Locating Postman within the Chrome Web Store.
Security warning presented when installing Postman.
Kicking off Postman from the Chrome App Launcher in Windows 7.
Basically, Postman is a Web REST client that allows you to enter and monitor HTTP requests and responses. Figure D shows the basic Postman interface, which is intuitive and easy to navigate. Most of Postman’s functionality is self-explanatory, so it’s easy to get up-and-running in no time. Online documentation is available, and the examples section provides a great starting point for many common tasks.
The Postman interface provides options for working with HTTP requests.
Using Postman can be as simple as entering the URL and sending the request (via the Send button) as I do with a local Node application in Figure D. The JSON returned by the request is delivered in the lower right portion of the window in the Body tab. There are tabs to view Cookies and Headers along with any tests defined. Other interesting bits of information about the request in Figure D are the status code returned (200 OK) and the time it took to process the request (426 ms). This is a basic HTTP Get example, but Figure E shows all of the HTTP verbs supported. Also, the URL params and Headers buttons to the right of the HTTP verbs allow you to set these values when making a request. Figure F shows them used to send a request to my Node application. If your application requires authentication, you can use the appropriate tab (Basic, Digest, OAuth, etc.) to enter the necessary values.
The HTTP verbs supported in Postman.
The HTTP verbs used to send a request to my Node application.
All requests are loaded and stored in the History pane located on the left of the Postman interface (Figure F); this allows you to return to previous requests to view the associated data at any time. In addition, requests can be stored in collections for later use, which is a timesaver when you don’t have to retype everything. You can access collections created by other users for free via the API Directory link at the top right of the Postman client.
Postman offers numerous settings to customize the environment.
Extending the extension
One caveat with Postman is the basic functionality of sending/manipulating requests is free, but the additional functions such as testing (test editor and runner) along with the collection runner are available via an add-on called Jetpacks. The add-on is available as a 14-day free trial, so you can test it before spending the $9.99 USD.
Another valuable tool for everyday work
Stay up on the latest Postman developments and discussions on its GitHub page. If you take Postman for a test drive, I think you’ll go back to it again and again.