Post your REST Calls with Postman

By February 1, 2014 February 27th, 2016 Uncategorized

Testing today’s REST-based web APIs requires some sort of tool for entering the URL as well as the various bits and pieces which accompany it such as URL parameters, header information, and form data. In a recent web API documentation project we started using a free, open-source tool called Postman which has turned out to be quite useful.

Postman is a free plug-in exclusively for Google Chrome which provides a web interface for issuing REST calls. The interface also lets you specify the type of operation (GET, POST, etc.), any number of header and URL parameters (as name/value pairs), as well as form-data in a variety of formats.

Once entered, the tool will send this information and display the response in either JSON or XML (though in our version, the latter option still seems to display JSON).  Any URLs returned in the response are automatically converted to hyperlinks which when clicked, will generate another API entry. This makes it easy to follow a path when following HATEOAS links. Additional response information is also made available such as cookie and header information as well as the call’s status and response time.

Another cool feature is that you can create collections of REST calls and save each call as part of a collection for execution at some point in the future. This makes it easy to create and organize a library of calls and to use them as starting points when testing new calls. Each call in the list can be assigned a descriptive name, and includes an icon indicating the method type (GET, POST, etc.) so that you can quickly see the type of REST operation. Various authorization schemes are also supported such as OAuth 1.0 (not sure about 2.0 at this point), basic user authentication, and digest access authentication.

One benefit to Postman is that it is not command line based like other tools are (e.g. CURL – a popular command line tool for testing WEB APIs). Since Postman has a nice user interface for entering parameters and other information, you don’t have to deal with cryptic command line switches, or the hassle of pasting text into a command line window. Instead you get to deal with nice edit fields and other GUI controls, which make Postman an instant win for anyone testing their web API.

Interestingly we found that some of the test calls which failed to work using CURL worked perfectly under Postman, suggesting that Postman is more robust and possibly up to date when it comes to transmitting and receiving REST information.

One downside to the UI is that the header and URL parameters are bunched together making it difficult to tell them apart. Also, the general layout and flow follows the non‑standard Windows layout found in many Google UI’s today, which takes some time to get used to. However, overall it’s very user friendly.

So if you do a lot of web API development, be sure to grab the Postman plug-in for chrome: http://www.getpostman.com/.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.