【问题标题】:how to rewrite the url in lowercase in WSO2如何在 WSO2 中以小写形式重写 url
【发布时间】:2023-01-20 23:52:11
【问题描述】:

我有一个网关 URL:https://baseurl/1.0.0/Api/Users/Login 并要求使用 URLRewrite Mediator 以小写形式重写。

需要导航到这里:https://baseurl/1.0.0/api/users/login 我应该在值、类型和片段属性中设置什么。

<rewrite>
  <rewriterule>
      <action value="tolowercase{url}" type="set" fragment="path"/>
  </rewriterule>
</rewrite>

【问题讨论】:

    标签: wso2 wso2-esb wso2-api-manager


    【解决方案1】:

    除了 URL 重写中介器,您可以使用属性中介器轻松完成此操作。

    <sequence xmlns="http://ws.apache.org/ns/synapse" name="NewAPI:v1.0.0--In">
        <property name="URL_POSTFIX" expression="get-property('axis2','REST_URL_POSTFIX')" />
        <property name="URL_POSTFIX_LOWER_CASE" expression="lower-case(get-property('URL_POSTFIX'))"/>
        <property name="REST_URL_POSTFIX" expression="get-property('URL_POSTFIX_LOWER_CASE')" scope="axis2" />
    </sequence>
    

    【讨论】:

      猜你喜欢
      • 2018-10-19
      • 1970-01-01
      • 2021-02-21
      • 2017-05-28
      • 2021-10-31
      • 2011-10-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多