バイナリ・コンテンツを送信
この手順は、バイナリ・コンテンツを送信するフローを作成する方法を示しています。
connectivity::restパラメータは、ペイロードに基づいてレスポンス・コンテンツの処理を暗黙的に決定します。 アクションの入力スキーマが入力タイプをバイナリとして定義し、バイナリ・オブジェクトがconnectivity::restの本文である場合、connectivity::restパラメータはバイナリ・ストリームとして処理されます。
完全なサンプル・コード:
"flows": {
"UploadFileFlow" : {
"id": "UploadFileFlow",
"description": "UploadFileFlow",
"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": "POST",
"body": "${ .input.File}"
}
},
"actionDataFilter": {
"results": "${ { body: .body, headers: .headers } }",
"toStateData": "${ .output }"
}
}
],
"name": "startState",
"type": "operation",
"end": true
}
]
}
}