Developer

Chrome add-on Postman streamlines testing APIs

Postman is a Web REST client that allows you to enter and monitor HTTP requests and responses. See why Tony Patton recommends taking this Chrome add-on for a test drive.

1_chrome_frame_hands.jpg

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).

Figure A

postmanfiga102914.jpg

Locating Postman within the Chrome Web Store.

Figure B

postmanfigb102914.jpg

Security warning presented when installing Postman.

Figure C

postmanfigc102914.jpg

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.

Figure D

postmanfigd102914.jpg

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.

Figure E

postmanfige102914.jpg

The HTTP verbs supported in Postman.

Figure F

postmanfigf102914.jpg

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.

The Tests tab allows you to create and save tests written in JavaScript; it comes with a collection of test snippets for basic tasks such as testing headers and status codes. In addition, you can create and load test data via CSV or JSON format files. Developers are a creative bunch that like to customize their tools and environment to their preferences, and Postman offers plenty of settings that can be used to match our style (Figure G).

Figure G

postmanfigg102914.jpg

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

Chrome is my de facto browser, and add-ons like Postman make it more of a standard component of my desktop. Postman makes it easy to learn the inner workings of my services or third-party APIs, as well as test functionality to make sure things are working as expected. It further taps into JavaScript skills to write tests as well as work with JSON data returned by HTTP requests.

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.

About Tony Patton

Tony Patton has worn many hats over his 15+ years in the IT industry while witnessing many technologies come and go. He currently focuses on .NET and Web Development while trying to grasp the many facets of supporting such technologies in a productio...

Editor's Picks

Free Newsletters, In your Inbox