CommandFusion Wiki

Documentation Resources

User Tools

Site Tools


software:gui-designer:system-manager:http-request-commands

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

software:gui-designer:system-manager:http-request-commands [2012/08/15 10:03]
aaron created
software:gui-designer:system-manager:http-request-commands [2015/05/17 22:58] (current)
jarrod [HTTP/HTTPS Systems]
Line 1: Line 1:
-====== HTTP Request Commands ​======+====== HTTP Requests ​======
  
 ===== Overview ===== ===== Overview =====
  
-Some devices only have a HTTP control protocol. These devices can be controlled from a web browser by entering specific URLs into the browser.\\ +Some devices only have a HTTP control protocol. These devices can be controlled from a web browser by entering specific URLs into the browser. 
-To control these devices via iViewer, the command value to send needs to be crafted to follow the HTTP Request standard formatting.+ 
 +To control these devices via iViewer, the communications can be defined in a variety of ways, depending on your requirements:​ 
 +  - [[#​httphttps-systems|HTTP/​HTTPS systems]] 
 +    - Easiest method.  
 +    - GET requests only. 
 +  - [[http://​www.commandfusion.com/​docs/​scripting/​net.html#​cF.request|CF.request JavaScript function]] 
 +    - Most powerful, but complicated method. 
 +  - [[#​manually-crafted-commands|Manually crafted commands via TCP systems]] 
 +    - Moderate complexity and flexibility. 
 +    - Not commonly used method. 
 +===== HTTP/HTTPS Systems ===== 
 +When you create a system in the guiDesigner System Manager, amongst the available protocol options are HTTP and HTTPS. These two options allow you to easily create HTTP GET Requests, either unsecured (HTTP), or secured (HTTPS). 
 + 
 +To use HTTP or HTTPS systems, you enter the root hostname or IP Address of the HTTP end point as the system hostname property. Then define the port to use, most commonly port 80 for HTTP or port 443 for HTTPS.\\ 
 + 
 +Then for the command values, all you have to enter is the request suffix. This should be the URL content after the hostname. 
 + 
 +So for example, if you control a device via a web browser with a URL such as:\\ 
 +''​http://​myhouse.dyndns.org:​8080/​transport?​action=playpause''​\\ 
 + 
 +Then the System Hostname would be ''​myhouse.dyndns.org''​ and port number ''​8080''​.\\ 
 +The command value would be ''/​transport?​action=playpause''​. 
 + 
 +===== Manually Crafted Commands ===== 
 + 
 +Alternatively,​ a raw TCP system can be used. In this case, the command value to send needs to be crafted to follow the HTTP Request standard formatting.
  
 ==== Basic Format ==== ==== Basic Format ====
Line 21: Line 46:
   - Finally end the request with two new lines (with carriage return if your system requires it).   - Finally end the request with two new lines (with carriage return if your system requires it).
  
-The command value is simply entered into the Command Properties when creating (or editing) a command in guiDesigner. +The command value is simply entered into the Command Properties when creating (or editing) a command in guiDesigner.\\ 
-{{:​software:​gui-designer:​http_command_properties.gif?​nolink |}} +{{ :​software:​gui-designer:​http_command_properties.gif?​nolink |}} 
 +\\
 The system the command belongs to needs to be defined to use port values of 80 (or whichever port the device listens on for HTTP requests, if unsure, try port 80) and set to TCP mode.\\ The system the command belongs to needs to be defined to use port values of 80 (or whichever port the device listens on for HTTP requests, if unsure, try port 80) and set to TCP mode.\\
 You should leave all other options empty. Checking '​maintain constant connection'​ might work with your device, so give it a try with or without this option checked. It will make a difference (good or bad) to the speed at which commands are received by the system. You should leave all other options empty. Checking '​maintain constant connection'​ might work with your device, so give it a try with or without this option checked. It will make a difference (good or bad) to the speed at which commands are received by the system.
- +\\ 
-{{:​software:​gui-designer:​http_system_properties.gif?​nolink |}}+{{ :​software:​gui-designer:​http_system_properties.gif?​nolink |}}\\
  
 ===== More Details ===== ===== More Details =====
Line 36: Line 61:
   * http://​en.wikipedia.org/​wiki/​HTTP   * http://​en.wikipedia.org/​wiki/​HTTP
   * http://​en.wikipedia.org/​wiki/​HTTP_headers   * http://​en.wikipedia.org/​wiki/​HTTP_headers
 +
 +The Requestb.in website is great for debugging HTTP requests, more info on their website:\\
 +http://​requestb.in
software/gui-designer/system-manager/http-request-commands.1345025009.txt.gz · Last modified: 2012/08/15 10:03 by aaron