Select Page

Postman – API development and testing made simple

by | Aug 23, 2018 | Development

As a Icinga 2 developer I often use the Icinga 2 REST API to test new features or debug Icinga itself. Of course most people use curl for that kind of task, and so did I.
That resulted in sometimes rewriting the same request a lot over the course of a few weeks. To counter that I just saved my most used requests into my notes which wasn’t that simple to maintain.
A few weeks ago that finally changed as I stumbled across Postman. Postman is a tool for developing, maintaining and testing REST APIs. I’d like to give you a quick rundown of its features, to show you why it has made my development life so much easier.



Requests require, like in most HTTP clients, a method, URL, headers and maybe a body, depending on the method. But in Postman you can also add tests and pre-request scripts written in JavaScript.


Collections and folders:

All your request can be sorted into collections and folders. That allows you to have variables and tests based on your current collection/folder.



In Postman collections and environments can have variables, if needed you can even create global variables. In the first example I used a collection variable called{{icinga-url}} which looks like this https://{{host}}:{{port}}/v1  and itself is based on two environment variables.



The only purpose of environments is to allow you to switch between sets of variables. You might need a URL and some credentials for a Icinga API at localhost and the same variables with different values for a customer setup.


Generate code from requests:

If you wan’t to use a request inside your software, Postman allows you to just export request as code. They provide a few common languages as seen below.


More features:

  • Test requests with JavaScript
  • Monitor APIs
  • Mock APIs
  • Generate API documentation
  • Generate request code from Postman (Curl, Python, C++ and more)
  • Darktheme (Most importent feature obviously)



Over the last few weeks it saved me a lot of time, because I didn’t need to rebuild my requests in curl every time I needed them. And if I’ll ever build an API from scratch, this will help me for sure.


Submit a Comment

Your email address will not be published. Required fields are marked *

More posts on the topic Development

Mein PHP-Trainingsprojekt

PHP Schulung Vor kurzem haben wir begonnen, eine neue Programmiersprache zu lernen – PHP. In der ersten Woche haben wir mit den Grundlagen wie Variablen, Arrays, Schleifen begonnen und uns schrittweise zu komplizierterer Syntax wie Funktionen, Objekten und Klassen...

check_prometheus ist jetzt öffentlich verfügbar!

Monitoring ist komplex, das wissen wir hier bei NETWAYS leider zu gut. Deswegen laufen in der Infrastruktur auch mal gerne mehrere Tools für die Überwachung. Zwei gern gesehene Kandidaten sind dabei Icinga und Prometheus. Icinga und Prometheus erfüllen...


In einer zunehmend digitalen Welt, in der Hochverfügbarkeit und Datensicherheit von größter Bedeutung sind, wird die Implementierung von RAID-Systemen immer wichtiger. Die für deinen Use Case passende Konfiguration eines RAID-Systems spielt deshalb eine nicht zu...