I’m an old programmer, ask me about COBOL sometime!
But I’m new to postman.
Is there a way to get postman to do variable substitution(s) when reading the request body from an external file?
I may be missing something very simple or painfully obvious, so any help would be appreciated.
Details are as follows:
I have a post request that uses two variables defined in the environment:
- the post URL uses the variable {{theURL}} to send the request to one of many servers
- the body uses the other variable {{myIP}} to forward the application GUI back to my PC
When I included the body in the request as a (raw) and the request functions as I expect.
The data is sent to the server specified by my environment variable {{theURL}}
The application forwards the GUI replies back to my PC using the enviroment variable {{myIP}}
The world is good.
I take the body text and put it into an external file, lets call it fred.json
I change the postman body to (binary), press select file, and select fred.json.
When I run this request thru postman it goes to the server specified by {{theURL}}
The application runs, but the GUI is not forwarded to my PC.
I edit fred.json and replace the variable {{myIP}} with the environment value, and save the file.
I run this request thru postman again.
It is sent to the correct server specified by {{theURL}}
The application runs and the GUI is now forwarded to my PC.
It looks to me like the external file is not being processed for any variable substitutions.
Thanks