Using variables as part of pre-defined device commands
Posted: Wed Feb 05, 2014 4:10 am
I have a device defined that contains 30 different commands. I would like to replace, for example, a hard coded address present in all 30 commands with a variable. Ex:
POST /cgi-bin/toServerValue.cgi HTTP/1.1\x0D\x0AContent-Length: 14\x0D\x0AContent-Type: text/plain; charset=ISO-8859-1\x0D\x0AHost: 192.168.1.17:3388\x0D\x0AConnection: Keep-Alive\x0D\x0A\x0D\x0A{"remote":"w"}
So, could I replace that address with a variable such as:
POST /cgi-bin/toServerValue.cgi HTTP/1.1\x0D\x0AContent-Length: 14\x0D\x0AContent-Type: text/plain; charset=ISO-8859-1\x0D\x0AHost: [IP-address]:3388\x0D\x0AConnection: Keep-Alive\x0D\x0A\x0D\x0A{"remote":"w"}
??
POST /cgi-bin/toServerValue.cgi HTTP/1.1\x0D\x0AContent-Length: 14\x0D\x0AContent-Type: text/plain; charset=ISO-8859-1\x0D\x0AHost: 192.168.1.17:3388\x0D\x0AConnection: Keep-Alive\x0D\x0A\x0D\x0A{"remote":"w"}
So, could I replace that address with a variable such as:
POST /cgi-bin/toServerValue.cgi HTTP/1.1\x0D\x0AContent-Length: 14\x0D\x0AContent-Type: text/plain; charset=ISO-8859-1\x0D\x0AHost: [IP-address]:3388\x0D\x0AConnection: Keep-Alive\x0D\x0A\x0D\x0A{"remote":"w"}
??