Postman 101
In this article, I will talk about variable definition, which is the biggest convenience provided by the Postman tool. This feature eliminates the constant manual process depending on the environment, thus speeding up the work done using different media.
The first is to create environments. In your Postman app, you’ll see the “Environments” area in the menus in the left corner of the tool. You can define a new environment by pressing the “+” sign.
In simple terms, an environment is a set of variables that you will only use for a particular endpoint. You can have a different group of them for each endpoint you are developing and you can switch between them with the drop-down menu in the same area.
Now in the dropdown, select “environment” (or whatever you named it). This will make the variable group we just created accessible when we are calling our endpoints. Open a tab and create a new URL with a variable:
When you “send” the URL, the {{host}} will be filled in with your variable (you won’t see this replaced in your tab — it is done internally at runtime). Why is this cool? You can export your Postman collection and share it with everyone else on the team, and they can simply change that variable to their own local URL or staging URL without having to change every single endpoint!