Search

Set Environment

Why Use an Environment?

An environment groups values that change between targets. Store the local API address once as base_url, then reuse it in requests instead of editing every URL.

Setup

1.
Create an environment, for example Local.
2.
Add base_url with a value such as http://127.0.0.1:8000.
3.
Select that environment for the request.
4.
Use {{base_url}}/items/12 as the request URL.
Switching environments changes the resolved value without changing the saved request. The server must still be running; an environment variable does not start it.

Things to Check

If a variable is unresolved, check its spelling, active environment, and scope. A value with the same name in a narrower scope can override the one you expected.
Use a suitable secrets store for credentials. Do not publish populated environments or assume that hiding a value on screen makes it safe to share. The screenshots below show an older Postman interface; variable-value labels may differ in the installed version.

Reference