Parameters
See plugin common configurations for configuration options available to all plugins.
request
object
Request body transformation configuration.
input_format
string
vaild vaule:
xml,json,encoded,args,plain, ormultipartRequest body original media type. If unspecified, the value would be determined by the
Content-Typeheader to apply the corresponding decoder.The
xmloption corresponds totext/xmlmedia type. Thejsonoption corresponds toapplication/jsonmedia type. Theencodedoption corresponds toapplication/x-www-form-urlencodedmedia type. Theargsoption corresponds to GET requests. Theplainoption corresponds totext/plainmedia type. Themultipartoption corresponds tomultipart/relatedmedia 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,_bodyto access request body, and_ctxto 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:
xmlorjsonResponse body original media type. If unspecified, the value would be determined by the
Content-Typeheader to apply the corresponding decoder. If the media type is neitherxmlnorjson, 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.