Send or Receive Form URL Encoded Content
This procedure shows how to implement a flow to send or receive form URL encoded content.
The connectivity::rest
function implicitly determines how the content is
handled based on the payload. This parameter treats the payload as form data if the content
type is application/x-www-form-urlencoded, and automatically converts the JSON key-value
pair into form-data.
Complete sample code:
"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",
"headers":{
"content-type":"application/x-www-form-urlencoded"
}
"body": "${ .input}"
}
},
"actionDataFilter": {
"results": "${ .body } }",
"toStateData": "${ .output }"
}
}
],
"name": "startState",
"type": "operation",
"end": true
}
]
}
}