Skip to content

Argument

Dynamic values provided at request-time.

An argument is a value that is sent in the request body and is then used across the route configuration.

Overview

Arguments are key-value pairs of values sent when a request is made to a route. It can be used in the route by using the args keyword, eg. ${args.currentDate}.

Configuration parameters like headers, destination URL and body can access arguments.

Examples

These are some examples of ways to use arguments in a route configuration. For the following examples we'll assume a request is being made to a route and the request has the body:

json
{
    "args": {
        "firstname": "john"
    },
    "body": {}
}

Notice the args keyword in the request body. This should be provided in every request to a route which has a configuration using it. If it isn't provided the original placeholder string is sent.

Destination URL

text
https://destination-server.com?key=${args.firstname}
Output
text
https://destination-server.com?key=john
json
{
	"X-Dynamic-Header": "Basic api:${args.firstname}",
	"not-sensitive-header": "hello_world"
}
Output
json
{
	"X-Dynamic-Header": "Basic api:john",
	"not-sensitive-header": "hello_world"
}

Body example

if "Use incoming request body" is unchecked and the body is provided in the route configuration.

json
{
	"dynamicFirstName": "${args.firstname}"
}
Output
json
{
	"dynamicFirstName": "john"
}