使用查询参数设置正文? [英] Use query parameters to set body?

查看:70
本文介绍了使用查询参数设置正文?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆