Index

HttpAction

  1. Description
  2. Configuration
  3. Example

Perform an HTTP request.

Description

This event handler performs an HTTP request on receipt of a triggering event. This HTTP request will typically cause some action at the target for example this could be a command to a webbrick. This may also be an HTTP request to any arbitrary device that is on the network, it could be easily be hardware not provided by WebBrickSystems as long as you have the details for the required HTTP uri required.

Configuration

The handler specific configuration for this expects one or more url elements within the event element. This contains the folllowing attributes

The url element may be repeated to get multiple requests isssued on a single trigger.

The uri attribute may contain items that are substituted from the triggering event, this is achieved by enclosing the name of a value in the events other data in %()s, e.g. above %(val)s. both the leading % and the trailing s are required.

Example

    <eventInterface module='EventHandlers.HttpAction' name='HttpAction'>
        <eventtype type="internal">
            <eventsource source="garagea/fore/30Sec" >
                <event>
                    <url address="garagea" uri="/hid.spi?COM=DT;A0;6;5;1;0;0::" cmd="GET" />
                    <url cmd='GET' uri='/hid.spi?COM=TT1;B;%(val)s:' address='10.100.100.100'/>
                </event>
            </eventsource>
        </eventtype>

    </eventInterface>
    

This example issues a command to the webbrick whose address is garagea, the command is 'DT;A0;6;5;1;0;0', see webbrick manual for the valid commands.