Skip to content

vanjikumaran/CustomHandler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CustomHandler

Sample Custom Handler for WSO2 APIM manger

Installation

Please read the official documentation for details. https://docs.wso2.com/display/AM180/Writing+Custom+Handlers#WritingCustomHandlers-Writingacustomhandler

Sample Synapse Configuration

<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>

Sample Request

curl -XPOST -H 'Accept: application/soap+xml' -H 'myOwnHeader: mindyourheader' -d '{"sample":{"hello":"world"}}' 'http://localhost:8280/world/v1'

Expected Response

Custom Header will be removed and Depend on the Accept header response payload will build.

About

Sample Custom Handler for WSO2 APIM manger

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages