Contact Free trial Login

To Configure a REST Proxy

  1. Construct the Mule XML configuration to specify the REST proxy as shown in the following example:

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:http=""
	xmlns="" xmlns:doc=""
  <api-platform-gw:api id="${}" apiName="${}" version="${api.version}" flowRef="proxy" doc:name="API Autodiscovery">
    <http:request-config name="http-request-config" host="${}" port="${implementation.port}" basePath="${implementation.path}" doc:name="HTTP Request Configuration"/>
    <http:listener-config name="HTTP_Listener_Configuration" host="" port="8081" doc:name="HTTP Listener Configuration"/>
    <flow name="proxy">
        <http:listener config-ref="HTTP_Listener_Configuration" path="${proxy.path}" parseRequest="false" doc:name="HTTP"/>
        <flow-ref name="copy-headers" doc:name="Flow Reference"/>
        <http:request config-ref="http-request-config" method="#[message.inboundProperties['http.method']]"
                      path="#[message.inboundProperties['http.request.path'].substring(message.inboundProperties['http.listener.path'].length()-2)]" parseResponse="false" doc:name="HTTP">
                <http:query-params expression="#[message.inboundProperties['http.query.params']]"/>
            <http:success-status-code-validator values="0..599" />
        <flow-ref name="copy-headers" doc:name="Flow Reference"/>
    <sub-flow name="copy-headers">
        <custom-transformer class="com.mulesoft.gateway.extension.CopyHeadersTransformer" doc:name="Java"/>
        <!-- This can be uncommented for customization
            <copy-properties propertyName="*"/>
            <remove-property propertyName="Host"/>
            <remove-property propertyName="Content-Length"/>
            <remove-property propertyName="MULE_*"/>
            <remove-property propertyName="Connection"/>
            <remove-property propertyName="Transfer-Encoding"/>
            <remove-property propertyName="Server"/>

+ . In the API project, configure the property placeholders in the configuration in the file, which you can find in the Package Explorer under src/main/app.

api.description=This is my API

+ If an API requires HTTPS communication, or returns internal API URLs as part of the response, additional configuration might be required.

+ The downloaded file is a deployable proxy application.

+ . If needed, modify the downloaded zip file to adjust for port conflicts, use shared connector resources, or include custom code for logic that you want to add to the proxy. Deploy the proxy application.

+ After deployment, the yellow circle in the status indicator turns green.

We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used and to tailor advertising. You can read more and make your cookie choices here. By continuing to use this site you are giving us your consent to do this.