Trigger - HTTP Request (Experimental)
The trigger HTTP Request (Experimental) is executed when a HTTP request is received using the specified path and port.
Note: The built-in webserver is neither fast nor should you try to upload large files. Please don't use it to run webshops, corporate websites or sites like Slashdot on your phone.
Examples:
- Send an SMS from your Phone using your PC when the URL
http://192.168.1.XX:8080/sms?receiver=12345&text=testis requested. - Return a page with the list of files on the SD card when the URL
http://192.168.1.XX:8080/files/xyzis requested.
Settings
Path
The path to handle by this trigger. Glob patterns (*, ?) are supported.
Examples:
Examples: The first trigger is preferred when two triggers with paths
Examples:
/automagic/test/automagic/files/*to handle all paths that start with/automagic/files/
Examples: The first trigger is preferred when two triggers with paths
/automagic/test and /automagic/* are available.
Port
The port of the server.
Bind to WiFi interface only
Whether to listen for HTTP requests on all interfaces or just on the WiFi interface.
Keep WiFi awake
Whether to keep the WiFi radio awake, otherwise the WiFi radio might turn off to save battery and a connection to your device is no longer possible.
Finish HTTP Response
Whether to finish the HTTP response by sending an empty response to the client.
A variable is a container for a value that can be used in many actions and conditions to dynamically define a part of a text.
See action Script for a description.
See action Script for a description.
Supplied Variables
triggertimethe time the trigger executed
remote_hostthe name or IP of the remote host
remote_portthe port of the remote host
request_paththe decoded path of the request (e.g.
/automagic/test)methodthe HTTP method (e.g. GET, POST, PUT)
header_*
All values of the headers. The name of the variable is built using the prefix
Examples:
header_ and the name of the header by replacing dash with underscore and converting the name to lowercase.Examples:
- Header
Acceptis stored in variableheader_accept - Header
Accept-Encodingis stored in variableheader_accept_encoding
param_*
All values of the request parameters. The name of the variable is built using the prefix
Example:
param_ and the name of the parameter by converting the name to lowercase.Example:
- Parameter
testis stored in variableparam_test
file_*
All paths of the uploaded files. The name of the variable is built using the prefix
Example:
file_ and the name of the parameter by converting the name to lowercase.Example:
- Parameter
Fileis stored in a variablefile_file
http_headersMap containing all unmodified names and values of the received HTTP headers
http_paramsMap containing all unmodified names and values of the received HTTP parameters
http_filesMap containing all unmodified form field names and paths to the uploaded files