Sending HTTP POST commands using the Event Manager is a simple task - in fact, it is the primary method that the controllers use to communicate with each other. But occasionally, you may come across a device that requires HTTP GET commands in order to control it.
POST vs. GET - What are these?
If you are familiar with web programming, you will know that POST and GET are 2 different HTTP request methods. In simple terms, they are a common method for a web client and a web server to pass information back and forth, via a URL encoded string. The main difference between the 2 is that GET transmits the data as part of the URL string that you see in your browser, while POST sends the message in the body.
Sending HTTP GET Commands from the Event Manager
DISCLAIMER - HTTP GET IS NOT OFFICIALLY SUPPORTED ON THE QX/NX CONTROLLERS. THIS WORKAROUND MAY WORK, BUT WE CANNOT GUARANTEE THAT EVERY DEVICE WILL FUNCTION PROPERLY
Below is a sample HTTP GET control string for a Panasonic network camera:
Broken down into TCP, this looks like this:
GET /cgi-bin/aw_ptz?cmd=#R00&res=1 HTTP/1.1 HOST: 192.168.1.90 Connection: close
Condensed into a single line for the Event Manager (notice the added line feed and carriage return):
GET /cgi-bin/aw_ptz?cmd=#R00&res=1 HTTP/1.1%0AHOST: 192.168.1.90%0AConnection: close%0A%0D
Now that you have the string, simply add that to a Telnet Action in WOWE or the Event Manager. Note that the "Use Telnet Encoding" checkbox is unchecked, and that the IP is specifying port 80.
Triggering this Event should now send the command to the device.
My Device Requires a Username and Password
In the event that your device requires a username and password to accept the command, then you can try sending it as part of the URL string. Note, this will only work if your device supports basic HTTP authentication:
GET http://user:firstname.lastname@example.org/cgi-bin/aw_ptz?cmd=#R00&res=1 HTTP/1.1%0AHOST: 192.168.1.90%0AConnection: close%0A%0D