HttpClient

HTTP POST/GET requests

What it does

When this branch is hit, it will compose a request URL and optionally an HTTP body. It will then send this request off to the specified server, and await a response. Cookies may be preserved, optionally.

How it works

{
    plugins = ["BasicHttpServer.dll",
        "Duckling.dll",
        "Networking.dll",
        "OutputComposing.dll"];

    instances = {
        anyrandomname = HttpService(
            refixes = ["http://*:8080/"]
        ) {
            http_branch = HttpClient(
                "www.ping.eu:80"
            ) {
                // Request main page ping.eu
                uri_branch = Write(
                    "http://www.ping.eu/");
                // And push that page to our
                // client
                response_branch = Bounce();
            };
        };
    };
}

Settings

(default) "string" hostname:port
hostname "string" hostname or ip to send requests to
port int port on host to use for requests
sessionid "string" when this is set and available in incoming context, cookies will be preserved, using the context value with this name as a unique key to assign cookies to.

Branches

_branch-name trigger interaction
uri will be used to assemble query url IOutgoingInteraction
response when the response starts coming in, this branch will be called IIncomingInteraction
postbuilder when this branch is set, it will provide the HTTP request body IOutgoingInteraction