x-amazon-apigateway-integration.requestParam - Amazon API Gateway
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

x-amazon-apigateway-integration.requestParam

对于 REST API,指定从给定的方法请求参数到集成请求参数的映射。要引用方法请求参数,必须先对其进行定义。

对于 HTTP API,指定传递给具有指定 AWS_PROXYintegrationSubtype 集成的参数。

属性
属性名称 类型 说明
integration.request.<param-type>.<param-name> string

对于 REST API,该值通常是 method.request.<param-type>.<param-name> 格式的预定义方法请求参数,其中 <param-type> 可以是 querystringpathheaderbody。但是,$context.VARIABLE_NAME$stageVariables.VARIABLE_NAMESTATIC_VALUE 也有效。对于 body 参数,<param-name> 是不带 $. 前缀的 JSON 路径表达式。

parameter string

对于 HTTP API,请求参数是键/值映射,用于指定通过指定的 AWS_PROXY 传递给 integrationSubtype 集成的参数。您可以提供静态值,或者在运行时评估的映射请求数据、阶段变量或上下文变量。要了解更多信息,请参阅“使用针对 HTTP API 的 Amazon 服务集成”。

x-amazon-apigateway-integration.requestParameters 示例

以下请求参数映射示例将方法请求的查询 (version)、标头 (x-user-id) 和路径 (service) 参数分别转换为了集成请求的查询 (stage)、标头 (x-userid) 和路径 (op) 参数。

注意

如果您通过 OpenAPI 或创建资源 Amazon CloudFormation,则应将静态值括在单引号中。

要从控制台添加此值,请在框中输入 application/json,无需引号。

"requestParameters" : { "integration.request.querystring.stage" : "method.request.querystring.version", "integration.request.header.x-userid" : "method.request.header.x-user-id", "integration.request.path.op" : "method.request.path.service" },