Skip to content

Routes: REST

TekMonks edited this page Mar 14, 2019 · 1 revision

The REST Client Route

The REST Client route node is used to call REST services i.e. APIs.

It supports all the REST methods like GET, POST, PUT etc.

This node will parse the parse the incoming response data itself into valid JSON. The property message.content contains the read data.

The code block below documents the format for the REST client route node.

"route1":{
    "type": "rest",
    "dependencies":["route0"],
    "host":"graphical.weather.gov",
    "port":443,
    "isSecure": true,
    "method":"get",
    "path": "",
    "timeout": 180000,
    "headers":["USER-AGENT: JSON_ESB", "ACCEPT: text/html,application/xhtml+xml,application/xml"]
}

The host property is used to point to the HTTP host.

The port is used to indicate the transport port.

isSecure is true for HTTPS calls, else false.

Supported methods are get, post, put and delete.

The path is the path portion of the URL i.e. the path after the host name.

timeout is the HTTP timeout.

headers are the HTTP headers to send to the remote server.