Testing a Web API with Postman

When you develop a web API and a client for it at the same time you often run into errors. But where did they happen? In the API? Or in the client? It would be a simple thing to pinpoint the source without that many moving parts. A stable client that works would be a great help. But where can you get one flexible enough to handle your API?

As it turns out there is a great extension for the Chrome browser that could save you hours. With Postman you have all the flexibility you need to test your API, and it is stable enough to find the errors in your API.

 

Installation

All you need to do is adding the Postman extension to your browser. You find it in the chrome web store or on getpostman.com:

PostmanChromeStore_t

The source code of Postman is on Github, just in case you want to see how it works.

 

Test your Service

To use Postman you only need to enter the URL and the key-value pairs for you parameters. Other request parameters can be added when your service needs them. The user interface is simple and when you hit send it will do exactly as told. The result of your request including the status code and the headers will be displayed at the bottom of your window:

PostmanGUI_t

You can use all the HTTP request methods like GET, POST, PUT, PATCH, HEAD and DELETE. With the ability not only to set URL parameters but also modify the request header you have all the possibilities of HTTP to your disposal. This makes Postman a great tool for exploratory testing once the bugs are found.

Often it gets really annoying when authentication is required. With Postman you can choose between Basic Auth, Digest Auth and OAuth 1. Should your errors only happen when authentication is required you don’t have to switch to another tool.

 

Conclusion

With this little extension you can save time and pinpoint the errors of your web service or API. And you don’t even have to leave your browser – as long as it’s chrome. Postman helped me to save countless hours of debugging and I can strongly recommend it for everyone building a web application.

1 thought on “Testing a Web API with Postman”

Leave a Comment

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