我们如何从Mule 4应用程序重定向到跨域URL?

我们如何从Mule 4应用程序重定向到跨域URL?,mule,anypoint-studio,mulesoft,Mule,Anypoint Studio,Mulesoft,我试图使用Mule 4应用程序重定向到外部网站URL,但只有端点在更改,并保持相同的(旧页面)域。但是我需要改变端点和外部域 我使用HTTP请求连接器来实现这一点 以下是我们的一些XML代码: <http:request-config name="HTTP_Request_configuration" doc:name="HTTP Request configuration" doc:id="14a8eee1-b907-4306-86da-d46eee402a56" >

我试图使用Mule 4应用程序重定向到外部网站URL,但只有端点在更改,并保持相同的(旧页面)域。但是我需要改变端点和外部域

我使用HTTP请求连接器来实现这一点

以下是我们的一些XML代码:

 <http:request-config name="HTTP_Request_configuration" doc:name="HTTP Request configuration" doc:id="14a8eee1-b907-4306-86da-d46eee402a56" >
        <http:request-connection protocol="HTTPS" host="partners.checkr.com" port="443" />
    </http:request-config>
    <flow name="OAuth2Flow" doc:id="fedc6c32-82fa-4e7d-bc4a-6425daf0642c" >
        <http:listener doc:name="Listener" doc:id="157b2a3d-ea31-4496-9808-b2b43058cccd" config-ref="HTTP_Listener_config" path="/"/>
        <http:request method="GET" doc:name="Request" doc:id="0502ced7-b52d-4f64-aee1-ed3525998fed" config-ref="HTTP_Request_configuration" path="/" followRedirects="true"/>
    </flow>
</mule>


重定向的方式应确保整个URL都被重定向(域+端点)。

要将它们完全重定向到其他域并离开mule应用程序,您可以设置302状态和位置标题:

<flow name="OAuth2Flow" doc:id="2e0b1fe9-0d1f-48a1-9d35-d272509de426" >
        <http:listener doc:name="Listener" doc:id="45692a0f-8c10-47c3-8b26-5bb9e7a715d5" config-ref="HTTP_Listener_config" path="/">
            <http:response statusCode="302" >
                <http:headers ><![CDATA[#[output application/java
---
{
    "Location" : "https://partners.checkr.com/"
}]]]></http:headers>
            </http:response>
        </http:listener>
        <logger level="INFO" doc:name="Logger" doc:id="66629470-b152-498d-9a37-801873348698" />
    </flow>

欢迎使用堆栈溢出!我认为您已经“忘记”实际包含您提到的XML代码。