User Tools

Site Tools


docu_http

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Last revision Both sides next revision
docu_http [2018/08/11 14:12]
Niek New version with DEVICE
docu_http [2018/08/14 16:24]
Niek Made DEVICE optional
Line 3: Line 3:
 ====Options for GET==== ====Options for GET====
 |GET|yes|no|The url for a GET request| |GET|yes|no|The url for a GET request|
-|DEVICE|yes|no|A generic_label device to receive the response|+|DEVICE|no|no|A generic_label device to receive the response|
  
 ====Options for POST==== ====Options for POST====
Line 12: Line 12:
 |DATA|yes|no|A parameterstring required for a POST request| |DATA|yes|no|A parameterstring required for a POST request|
 |MIMETYPE|yes|no|The mimetype required for a POST request| |MIMETYPE|yes|no|The mimetype required for a POST request|
-|DEVICE|yes|no|A generic_label device to receive the response|+|DEVICE|no|no|A generic_label device to receive the response|
  
 ====Description==== ====Description====
  
-The http action can perform hhp(s) GET and POST requests. It requires ​a generic_label device to store the response of the request. ​The label- and color fields of the label device are respectively being used to store the received data and the corresponding code, size and mimetype. ​+The http action can perform hhp(s) GET and POST requests. It can optionally be used with a generic_label device to store the response of the request. ​ 
 + 
 +If a device is given. the label- and color fields of the label device are respectively being used to store the received data and the corresponding code, size and mimetype. ​
  
 While the http request in in progress, the color field is set to "​busy"​. **During that time any new http request for the same device will be skipped.** While the http request in in progress, the color field is set to "​busy"​. **During that time any new http request for the same device will be skipped.**
Line 58: Line 60:
 </​code>​ </​code>​
  
 +If no device is given, the result of the http request is ignored.
  
 ====Examples==== ====Examples====
  
 <​code>​ <​code>​
-   IF 1 == 1 THEN http GET '​http://​www.somewebsite.com/' ​DEVICE mylabel+   IF 1 == 1 THEN http GET '​http://​www.somewebsite.com/'​
  
    IF 1 == 1 THEN http GET '​http://​www.somewebsite.com/'​ DEVICE mylabel    IF 1 == 1 THEN http GET '​http://​www.somewebsite.com/'​ DEVICE mylabel
Line 70: Line 73:
    IF 1 == 1 THEN http POST '​http://​www.somewebsite.com/'​ DATA '​command=show&​format=xml'​ MIMETYPE '​text/​plain'​ DEVICE mylabel    IF 1 == 1 THEN http POST '​http://​www.somewebsite.com/'​ DATA '​command=show&​format=xml'​ MIMETYPE '​text/​plain'​ DEVICE mylabel
  
-   IF 1 == 1 THEN http GET '​http://​192.168.1.1/​myserver/' ​DEVICE mylabel+   IF 1 == 1 THEN http GET '​http://​192.168.1.1/​myserver/'​
 </​code>​ </​code>​
  
-Other rules can be triggered using the change of the color field:+If a device is given, other rules can be triggered using the change of the color field:
  
 <​code>​ <​code>​
docu_http.txt · Last modified: 2018/08/18 11:35 by Niek