Reputation: 365
Postman ignores the protocol and port nr in a variable:
I have a host variable set up to contain a custom port:
When I try to use the variable, it doesn't contain protocol nor port:
Do I have to do something special to have the protocol and port nr remembered?
Upvotes: 1
Views: 799
Reputation: 19979
https://learning.postman.com/docs/sending-requests/variables/#variable-scopes
Scope:
Meaning if you have global variable defined then it will be visible for all collections and environment variable will be visible only for that particular environment.
Precedence
if you have a variable with same name defined in both environment and collection then the value will be taken from environment. as precedence is collection < environment
Upvotes: 2
Reputation: 79
Is there another host variable set ? As that one shows scope Environment in the second screenshot and the first screenshot shows it set at collection scope. Try to rename the host variable for the collection to something else and then try to call it in the same collection and see what it shows. Verification On both the postman Linux and Web client, setting a collection variable called host like yours showed the protocol and port on calls within that collection.
Upvotes: 1