1. Open the URL for variables and environment variables: https://learning.postman.com/docs/postman/variables-and-environments/variables/ . Variables and environment variables. Using variables allows you to store and reuse values in requests and scripts. As shown in Figure 1

2. Click Environment quick look (the eye button) in the upper right corner of Postman, then click the Add button next to Environment. As shown in Figure 2

3. Add a variable named channel_pub_api_host_info and set its initial value to http://api.channel-pub-api.localhost , add a variable named channel_pub_api_base_url and set its initial value to /v1 , then click the Add button. As shown in Figure 3

4. Make a GET request in Postman: http://api.channel-pub-api.localhost/qq/v1/qq-cw-apps?group_id=015ce30b116ce86058fa6ab4fea4ac63 , as shown in Figure 4

5. Replace http://api.channel-pub-api.localhost with: {{channel_pub_api_host_info}}, replace /v1 with: {{channel_pub_api_base_url}}, click the No Environment dropdown list in the upper right corner of Postman, and select 渠道发布接口 ( 本地环境 ). Hover over the variable name: {{channel_pub_api_host_info}}, and you can see its value is: http://api.channel-pub-api.localhost . As shown in Figure 5

6. Make a GET request in Postman: {{channel_pub_api_host_info}}/qq{{channel_pub_api_base_url}}/qq-cw-apps?group_id=015ce30b116ce86058fa6ab4fea4ac63 , the actual request URL: http:///qq/qq-cw-apps?group_id=015ce30b116ce86058fa6ab4fea4ac63 , the environment variables are not replaced, which does not meet expectations. As shown in Figure 6

7. Reset the environment variables by setting the CURRENT VALUE, as shown in Figure 7

8. Make a GET request in Postman: {{channel_pub_api_host_info}}/qq{{channel_pub_api_base_url}}/qq-cw-apps?group_id=015ce30b116ce86058fa6ab4fea4ac63 , the actual request URL: http://api.channel-pub-api.localhost/qq/v1/qq-cw-apps?group_id=015ce30b116ce86058fa6ab4fea4ac63 , the environment variables have been replaced, meeting expectations. As shown in Figure 8

9. At this point, the request URL is for the local environment. To prepare to request the development environment URL, add a new set of environment variables: 渠道发布接口 ( 开发环境 ), as shown in Figure 9

10. Click the No Environment dropdown list in the upper right corner of Postman, and select 渠道发布接口 ( 开发环境 ). Make a GET request in Postman: {{channel_pub_api_host_info}}/qq{{channel_pub_api_base_url}}/qq-cw-apps?group_id=015ce30b116ce86058fa6ab4fea4ac63 , the actual request URL: https://api.channel-pub.wjdev.chinamcloud.cn/qq/v1/qq-cw-apps?group_id=015ce30b116ce86058fa6ab4fea4ac63 , the environment variables have been replaced, meeting expectations. Note: The response uses http instead of https because of the development environment itself, which is unrelated to Postman. As shown in Figure 10

11. Click Environment quick look (the eye button) in the upper right corner of Postman, then click the Edit button next to Globals. Add a variable named group_id, and set its initial value and current value to 015ce30b116ce86058fa6ab4fea4ac63 , as shown in Figure 11

12. Make a GET request in Postman: {{channel_pub_api_host_info}}/qq{{channel_pub_api_base_url}}/qq-cw-apps?group_id={{group_id}} , the actual request URL: http://api.channel-pub-api.localhost/qq/v1/qq-cw-apps?group_id=015ce30b116ce86058fa6ab4fea4ac63 , the environment variables have been replaced, meeting expectations. Switching to the 2 environments respectively, both will automatically replace the value of {{group_id}} with: 015ce30b116ce86058fa6ab4fea4ac63. That is, global variables can be used across all environments. As shown in Figure 12

13. If variables with the same name are declared in two different scopes, the value stored in the variable with the narrowest scope will be used. At this stage, only the scopes Global and Environment are used. Global variables allow you to access data across collections, requests, test scripts, and environments. Environment variables allow you to tailor processing for different environments, such as local development versus testing or production. Only one environment can be active at a time. As shown in Figure 13

14. In the local environment, add a variable named group_id, and set its initial value and current value to 5ea4502c6f2f11eaa9874577d836ad48 , click the No Environment dropdown list in the upper right corner of Postman, and select 渠道发布接口 ( 本地环境 ). Make a GET request in Postman: {{channel_pub_api_host_info}}/qq{{channel_pub_api_base_url}}/qq-cw-apps?group_id={{group_id}} , the actual request URL: http://api.channel-pub-api.localhost/qq/v1/qq-cw-apps?group_id=5ea4502c6f2f11eaa9874577d836ad48 , the environment variables have been replaced, meeting expectations. That is, the environment variable overrides the global variable {{group_id}}. As shown in Figure 14

