バイナリ・コンテンツの受信
この手順は、バイナリ・コンテンツを受信するフローを作成する方法を示しています。
サンプル・コードは、接続プロパティを使用してAPIホスト情報を受信する方法を示しています。 connectivity::restファンクションは、ペイロードに基づいてレスポンス・コンテンツの処理を暗黙的に決定します。 レスポンスがアタッチメントであり、マルチパートではない場合、この関数はレスポンスをバイナリとして扱います。
完全なサンプル・コード:
"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
}
]
}
}