Auxiliary Operations
WebRelay Users Manual
5.2 HTTP GET Requests (for custom applications)
The WebRelay has a built-in web server that responds to HTTP GET requests. These GET requests are
sent from web browsers when a web page is requested. They are fairly similar to the actual addresses
seen in the browser's address bar. The following section describes the HTTP GET protocol and how it
can be used to control and monitor the WebRelay.
5.2.1 Using GET for Control and Monitoring
No Password
Example: Request home.html
GET /home.html HTTP/1.1\r\n\r\n
Example: Turn Relay ON
GET /state.xml?relayState=1 HTTP/1.1\r\n\r\n
Password Enabled
If the control password is enabled in the WebRelay and the XML page is requested through a browser,
the browser will prompt the user for the password. If the XML request is sent from another application
and not a browser, the html request will need to contain the password encoded using the base 64
encoding scheme. The html request header without the password looks like this:
GET /state.xml?noReply=1 HTTP/1.1 (Terminated with two \r\n)
The html request header with the password looks like this:
GET /state.xml?relayState=1&noReply=1 HTTP/1.1 (Terminated with two
\r\n)
Authorization: Basic bm9uZTp3ZWJyZWxheQ== (Terminated with two \r\n)
Where bm9uZTp3ZWJyZWxheQ== is the base 64 encoded version of the username and password
none:webrelay
A utility is provided at http://www.ControlByWeb.com/encoder that can be used to encode the password.
The utility is used by simply typing the string username:password into the website and pressing encode.
Page 62
Xytronix Research & Design, Inc.