Override Default Content Handling in connectivity::rest
By default, the connectivityt::rest function implements a
default behavior that handles the request and response content based on the content headers
and actual content type like binary and JSON.
The Rapid Adapter Builder platform allows you to override the default implementation behavior.
To override the default behavior in request phase, add the following argument
to connectivity::rest function.
Note:
Valid values forrequestMediaType are structured,
form-urlencoded, multipart, and
binary.
Sample code:
{
"functionRef": {
"refName": "httpOutbound",
"arguments": {
"uri": "${.connectionProperties.baseURL + \"/orders\"}",
"method": "POST",
"requestMediaType" : "binary"
}
},
"actionDataFilter": {
"results": "${ { File: .body} }",
"toStateData": "${ .output }"
}
}
To override the default behavior in response phase, add the following argument
to connectivity::rest function.
Note:
Valid values forresponseMediaType are structured,
form-urlencoded, multipart, and
binary.
Sample code:
{
"functionRef": {
"refName": "httpOutbound",
"arguments": {
"uri": "${.connectionProperties.baseURL + \"/orders\"}",
"method": "GET",
"responseMediaType" : "binary"
}
},
"actionDataFilter": {
"results": "${ { File: .body} }",
"toStateData": "${ .output }"
}
}