From the course: Introducing Postman

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Using variables in requests

Using variables in requests - Postman Tutorial

From the course: Introducing Postman

Start my 1-month free trial

Using variables in requests

- [Instructor] We can reference variables in virtually every aspect of our requests. Be it in the URL, parameters, header or body. All we need to do is wrap the variable name in curly brace pairs. Let's compose a new request using our environment variables. Following our previous process for defining your request, the first thing we do is enter the URL. This is still the case, but rather than typing the URL directly we want to use the base URL instead. I'll begin by entering the curly braces. Notice how as soon as I started typing, Postman displayed the list of a variable variables. The first items, guid, randomint and timestamp all belong to a special category of variables called dynamic global variables. These are essentially functions which inject non-deterministic values into your request wherever they're referenced. I find the guid and timestamp variables particularly useful for requests which create or modify objects. Continuing down the list, the remaining items are displayed…

Contents