Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Azure API管理中访问路由参数 查询字符串参数_Azure_Azure Api Management - Fatal编程技术网

如何在Azure API管理中访问路由参数 查询字符串参数

如何在Azure API管理中访问路由参数 查询字符串参数,azure,azure-api-management,Azure,Azure Api Management,我已经看到了大量读取查询字符串参数的示例 例如,以以下URI为例: /api/Profile?id={accountId} 可以使用以下语法在策略xml中读取accountId: context.Request.Url.Query[“accountId”] 路由参数 但是,如果我的URI结构为: /api/profiles/{accountId} 当参数不在查询字符串中时,如何读取策略xml中的accountId。使用上述示例,我可以通过以下语法读取accountId: context.Requ

我已经看到了大量读取查询字符串参数的示例

例如,以以下URI为例:

/api/Profile?id={accountId}

可以使用以下语法在策略xml中读取
accountId

context.Request.Url.Query[“accountId”]

路由参数 但是,如果我的URI结构为:

/api/profiles/{accountId}


当参数不在查询字符串中时,如何读取策略xml中的
accountId

使用上述示例,我可以通过以下语法读取
accountId

context.Request.MatchedParameters[“accountId”]

例如,我可以将其分配给APIM策略文件中其他地方使用的变量:

关于它的文档并不多,但谢天谢地,至少在docs.microsoft.com上有