[英]WSO2 API Manager 1.9.1 - Routing
WSO2 API Manger中有什么方法可以從請求xml / json(有效負載)中讀取參數值,並基於該值將請求路由到其他后端端點?
您可以嘗試使用中介程序擴展。
API管理器具有針對其接收的API調用請求的默認中介流。 您可以擴展此默認中介流以路由請求。
<sequence xmlns="http://ws.apache.org/ns/synapse" name="YahooWeather2"> <property name="YQL" type="Expression" expression="concat('?q=select%20*%20from%20weather.forecast%20where%20woeid%20in%20(select%20woeid%20from%20geo.places(1)%20where%20text%3D%22',syn:get-property('uri.var.zipcode'),',',syn:get-property('uri.var.country'),'%22)format=json')"/> <property name="REST_URL_POSTFIX" type="Expression" expression="get-property('YQL')" scope="Axis2"/> </sequence>
您可以從API存儲區中的API控制台檢查可用性。 有關更多詳細信息,請參閱https://docs.wso2.com/display/AM191/Change+the+Default+Mediation+Flow+of+API+Requests
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.