我有一个多租户API,我正在尝试使用wso2对它进行RESTIFY。我正在尝试一种在url中传递租户值的方法。
本地主机:8290//tenant/api/.
https://tenant.xyz.com/api/..。
我尝试了İ集成工作室,并通过创建一个名为{İ}的属性并将其设置为承租者名称,成功地在http端点中传递了一个文本租户值。但是,我不知道怎么从这里取房客的名字
本地主机:8290/tenant/api
把它传过来。
我也尝试使用APIM发布页面,但没有成功。
发布于 2021-11-06 06:24:49
如我所见,你的问题有两部分。
对于第一个方法,您所遵循的方法是正确的,在https://apim.docs.wso2.com/en/latest/integrate/examples/endpoint_examples/using-http-endpoints/#example-1-populating-an-http-endpoint-during-mediation上可以找到一个示例。剩下的是读取path参数和填充{uri.var.tenant},这是第二点。
对于第二点,您可以使用URL模板创建和API定义。请参阅https://apim.docs.wso2.com/en/latest/reference/synapse-properties/rest-api-properties/中的属性URI模板,您可以在https://apim.docs.wso2.com/en/latest/integrate/examples/rest_api_examples/setting-query-params-outgoing-messages/#reading-a-query-or-path-parameter上找到一个使用示例
https://stackoverflow.com/questions/69851649
复制相似问题