Use Environment Variable In Postman

When we are maintaining the development, staging, and production server then it helps to make it easier for the test process.

Arnish Gupta
3 min readJul 7, 2020

Postman is a very popular tool to test the API. It has many features but we will look here to set the environment variable. We are very much familiar with the “environment variable”, It replaces it as per the server.

We can set the environment variable everywhere in API Request.

Photo by Jordan Harrison on Unsplash

We will look this process in simple steps:

  • Step 1: Open the postman tool and click the setting icon on the below image.
  • Step 2: You can see a popup like the below image. Click on the Add button.
  • Step 3: In the below image: Blue color set the name of the environment. Strawberry color identifies the name of the variable, Green color set the initial value (This value is shared with your team when you share a variable in a collection). Grey color set the current value (This value is used while sending a request it never syncs to postman servers). You can create multiple variables respectively. Click on the Add button for the next process and close the popup.
  • Step 4: You can use this variable using the curly braces everywhere in the request. like this: {{base-url}}. I created a new environment for the Production server on the below image.

Let’s test this process. Select the environment variable as per below image

Then make the API request with the environment variable.

That’s it. I hope it will help to manage the API requests. If you have any query you can write in the comments section and you can share your happiness with me using the claps.

Thank you for reading !!

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

No responses yet

Write a response