使用查询参数设置正文? [英] Use query parameters to set body?
问题描述
我想在API管理中使用参数(例如param1)设置GET操作,然后使用主体中的param1的值将其发布到后端.我尝试了许多不同的变体,但似乎无法使其正常工作.有人可以告诉我正确吗 句法?示例:
I want to set up a GET operation with a parameter (e.g. param1) in API management, and POST it to the backend, using the value of param1 in the body. I've tried a bunch of different variations, but can't seem to get it to work. Can someone tell me the correct syntax? Example:
< set-body template =液体">
{
"xyz123" :
{
"param1" : "{{context.Request.MatchedParameters.param1}}"
<set-body template="liquid">
{
"xyz123" :
{
"param1" : "{{context.Request.MatchedParameters.param1}}"
}
}
}
</set-body>
</set-body>
推荐答案
请参阅此文章: https://docs.microsoft.com/zh-cn/azure/api-management/api-management-transformation-policies#a-namesetquerystringparametera-set-query-string-parameter 描述,如何设置查询字符串参数.
Refer this article: https://docs.microsoft.com/en-us/azure/api-management/api-management-transformation-policies#a-namesetquerystringparametera-set-query-string-parameter which describes, How to set query string parameter.
这篇关于使用查询参数设置正文?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!