How to Set Base URL in Postman for API Testing
To set the base_url variable in Postman for APIs, follow these steps:
-
Open Postman and go to the 'Manage Environments' option located on the top right corner.
-
Click on 'Add' to create a new environment.
-
Give a name to the environment and add the base URL of the API in the 'INITIAL VALUE' field. For example, if the base URL is 'https://api.example.com/v1', then enter it in the field.
-
Click on 'Add' to save the environment.
-
Now, in the API requests, use the variable {{base_url}} instead of the actual URL.
-
To select the environment, click on the dropdown menu on the top right corner and select the environment you just created.
-
The base URL will now be automatically set for all the API requests in that environment.
原文地址: https://www.cveoy.top/t/topic/mkIB 著作权归作者所有。请勿转载和采集!