Receive Binary Content
This procedure shows how to create a flow to receive binary content.
The sample code shows how to use connection properties to receive API host information. The
connectivity::rest
function implicitly determines the response content
handling based on payload. If response is attachment and not multipart, the function treats
the response as binary.
Complete sample
code:
"flows": {
"DownloadFileFlow" : {
"id": "DownloadFileFlow",
"description": "DownloadFileFlow",
"version": "0.1",
"start": "startState",
"specVersion": "0.8",
"functions": [
{
"name": "httpOutbound",
"operation": "connectivity::rest",
"type": "custom"
}
],
"states": [
{
"actions": [
{
"functionRef": {
"refName": "httpOutbound",
"arguments": {
"uri": "${.connectionProperties.baseURL + \"/orders\"}",
"method": "GET"
}
},
"actionDataFilter": {
"results": "${ { File: .body} }",
"toStateData": "${ .output }"
}
}
],
"name": "startState",
"type": "operation",
"end": true
}
]
}
}