Revision 1.1
3.2.2 GET Requests
GET requests can be used by custom applications to request information from the device, set
parameters, and control the Outlets.
No Password Enabled
GET requests to the device for XML files:
Example: Request about.html
GET /about.html HTTP/1.1\r\n\r\n
Example: Turn Outlet 1 ON
GET /state.xml?relay1State=1 HTTP/1.1\r\n\r\n
Password Enabled
If the control password is enabled in WebSwitch™ unit and the state.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?relay1State=1&noReply=1 HTTP/1.1 (Terminated with two \r\n\)
The html request header with the password looks like this:
GET /state.xml?relay1State=1&noReply=1 HTTP/1.1 (Terminated with \r\n)
Authorization: Basic bm9uZTp3ZWJzd210Y2g= (Terminated with two \r\n)
where bm9uZTp3ZWJzd2l0Y2g= is the base 64 encoded version of the user name and password
none:webswitch
A utility is provided at http://www.controlbyweb.com/encoder to encode the password. Simply type the
string username:password into the website and press 'encode'.
Xytronix Research & Design, Inc.
WebSwitch™ Users Manual
68
Need help?
Do you have a question about the WebSwitch XRDI-WS3 and is the answer not in the manual?