how to create environments variable in postman
To create an environment variable in Postman, follow these steps:
- Click on the gear icon in the top right corner of the Postman window.
- Select "Manage Environments" from the dropdown menu.
- Click on the "Add" button to create a new environment.
- Give your environment a name and add any initial key-value pairs that you want to include.
- To use an environment variable in a request, simply use the syntax {{variable_name}} where you want to substitute the value of the variable.
For example, if you had an environment variable called "base_url" with a value of "https://api.example.com/v1", you could use it in a request like this:
GET {{base_url}}/users
This would substitute the value of the "base_url" variable into the URL of the request, resulting in a final URL of "https://api.example.com/v1/users".
原文地址: https://www.cveoy.top/t/topic/tMH 著作权归作者所有。请勿转载和采集!