在for循环内启动动态HTTP请求 [英] Initiate Dynamic HTTP request inside for loop
本文介绍了在for循环内启动动态HTTP请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨团队
我正在尝试在Azure APIM中实现以下场景.请提出一种实现相同目的的方法
I am trying to achieve the below scenerio in azure APIM. Please suggest a way to implement the same
场景:
- 根据queryparam(keys)** corp中逗号分隔的值来构建动态请求. xyz.com?key=a
** corp.xyz.com?key = b
** corp.xyz.com?key = c - 获取每个响应并将其混搭为单个响应
- Read a value from queryparam : keys=a,b,c
- Frame a dynamic request based on the comma separated values in queryparam(keys)**corp.xyz.com?key=a
**corp.xyz.com?key=b
**corp.xyz.com?key=c - Get the response of each and mash them as single response
推荐答案
这应该是通过使用这些政策规则可以实现
This should be possible by using these policy rules
-
您应该能够使用诸如
context.Request.Url.Query.GetValueOrDefault("keys")
或上下文.Request.MatchedParameters.GetValueOrDefault("keys")
.Refer this for more information about retrieving query parameters.
- 然后使用选择
-
Then control the flow using
choose
and have conditions for each key value you are expecting
在您之前的状况阻止中, rewrite-uri policies 相应地
In your condition blocks from before, have rewrite-uri
policies
accordingly
所有这些都在您的 阻止.
这篇关于在for循环内启动动态HTTP请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文