Parameters
See plugin common configurations for configuration options available to all plugins.
request
object
required
Request body transformation configuration.
input_format
string
vaild vaule:
xml
,json
,encoded
,args
, orplain
Request body original media type. If unspecified, the value would be determined by the
Content-Type
header to apply the corresponding decoder.The
xml
option corresponds totext/xml
media type. Thejson
option corresponds toapplication/json
media type. Theencoded
option corresponds toapplication/x-www-form-urlencoded
media type. Theargs
option corresponds to GET requests, and theplain
option corresponds totext/plain
media type.If the media type is neither type, the value would be left unset and the transformation template will be directly applied.
template
string
required
Request body transformation template. The template uses lua-resty-template syntax. See the template syntax for more details.
You can also use auxiliary functions
_escape_json()
and_escape_xml()
to escape special characters such as double quotes,_body
to access request body, and_ctx
to access context variables. See examples to learn more.template_is_base64
boolean
Set to true if the template is base64 encoded.
response
object
Response body transformation configuration.
input_format
string
vaild vaule:
xml
orjson
Response body original media type. If unspecified, the value would be determined by the
Content-Type
header to apply the corresponding decoder. If the media type is neitherxml
norjson
, the value would be left unset and the transformation template will be directly applied.template
string
required
Response body transformation template.
template_is_base64
boolean
Set to true if the template is base64 encoded.