Sample Custom Handler for WSO2 APIM manger
Please read the official documentation for details. https://docs.wso2.com/display/AM180/Writing+Custom+Handlers#WritingCustomHandlers-Writingacustomhandler
<api name="admin--hello" context="/world" version="v1" version-type="url"> <resource methods="POST GET OPTIONS DELETE PUT" url-mapping="/*"> <inSequence> <property name="POST_TO_URI" value="true" scope="axis2"/> <filter source="$ctx:AM_KEY_TYPE" regex="PRODUCTION"> <then> <loopback/> </then> <else> <sequence key="sandbox_key_error"/> </else> </filter> </inSequence> <outSequence> <log level="full"/> <send/> </outSequence> </resource> <handlers> <handler class="org.wso2.carbon.apimgt.gateway.handlers.security.APIAuthenticationHandler"/> <handler class="org.wso2.carbon.apimgt.usage.publisher.APIMgtUsageHandler"/> <handler class="org.wso2.carbon.test.gateway.CustomHandler"/><!--Changed this according to your Custom Handler--> <handler class="org.wso2.carbon.apimgt.gateway.handlers.ext.APIManagerExtensionHandler"/> </handlers> </api>
curl -XPOST -H 'Accept: application/soap+xml' -H 'myOwnHeader: mindyourheader' -d '{"sample":{"hello":"world"}}' 'http://localhost:8280/world/v1'
Custom Header will be removed and Depend on the Accept header response payload will build.