【发布时间】:2014-10-21 04:10:33
【问题描述】:
您好,我在这里尝试通过一个代理调用两个不同的端点。
第一个端点:基本上它是我编码到 .js 文件中的 java 脚本 第二个端点:这是一个端点,我必须将请求发送到第三方 URL 并获取响应并返回。
所以我想在我的查询字符串中发送一个参数,如下所示:
http://[url to my apigee proxy]/endpoint?stub=true
如果这是 url,那么它应该转到我的 JavaScript 代码。如果这是网址:
http://[url to my apigee proxy]/endpoint?stub=false
然后它应该转到第三方网址。我已经看过并尝试实现这一点;
http://stackoverflow.com/questions/22783986/one-api-proxy-calling-two-different-target-endpoints 但它不适合我。
任何建议将不胜感激。
【问题讨论】:
-
您粘贴的链接就是答案。您能否详细说明您在使用这种方法时面临的问题?
-
它总是路由到 target1 吗?你看到了什么行为?
-
嗨@Srikant 这是我所做的,但它对我不起作用:
<RouteRule name="routeToTarget2"> <Condition>thetype == "xyz"</Condition> <TargetEndpoint>target2</TargetEndpoint> </RouteRule> <RouteRule name="routeToTarget1"> <TargetEndpoint>target1</TargetEndpoint> </RouteRule> -
嗨 @Srikanth 我刚刚添加了我的 apigee UI 的屏幕截图
标签: javascript apigee