Sample interceptors which are relevant for WSO2 API Microgateway request and response formatting.
This module provides two basic interceptors for json to xml and xml to json message transformations.
-
The request interceptor (
xmlToJsonFormatter.bal) will convert a XML payload to a JSON payload.Syntax:
x-wso2-request-interceptor: praminda/formatters/0.4.0:formatRequest
-
The response interceptor (
jsonToXmlFormatter.bal) will convert a JSON payload to a XML payload.Syntax:
x-wso2-response-interceptor: praminda/formatters/0.4.0:formatResponse