(Classic) send_directive()

send_directive(<name>) with options

Send a directive to the endpoint. Action modifiers are used to send directive options:

  with body = "Hello World"

The <name> can be any text that identifies the directive to the endpoint. 

The options are given as a map. The map can include any keys and values that the developer wishes. 

A module exists for that simplifies working with send_directive.

The following ruleset shows send_directive() being used

ruleset a1299x188 {
	meta {
		name "Send Directive Example"
		author "nathan cerny"
		logging on
	dispatch {
		// domain "exampley.com"
    rule page_view {
        select when pageview ".*"
        pre {
	     resp = 
	     content = resp.pick("$..content");
        append("body", "<h1>Directive Response: </h1>" + content);
	rule directive_example {
		select when webhook directive_example
		send_directive("text") with body = "my text response";

Copyright Picolabs | Licensed under Creative Commons.