

# x-amazon-apigateway-integration.requestParameters 对象
<a name="api-gateway-swagger-extensions-integration-requestParameters"></a>

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

对于 HTTP API，指定传递给具有指定 `AWS_PROXY` 的 `integrationSubtype` 集成的参数。


| 属性名称 | 类型 | 说明 | 
| --- | --- | --- | 
| integration.request.<param-type>.<param-name> | string |  对于 REST API，该值通常是 `method.request.<param-type>.<param-name>` 格式的预定义方法请求参数，其中 `<param-type>` 可以是 `querystring`、`path`、`header` 或 `body`。但是，`$context.VARIABLE_NAME`、`$stageVariables.VARIABLE_NAME` 和 `STATIC_VALUE` 也有效。对于 `body` 参数，`<param-name>` 是不带 `$.` 前缀的 JSON 路径表达式。  | 
| parameter | string |  对于 HTTP API，请求参数是键/值映射，用于指定通过指定的 `AWS_PROXY` 传递给 `integrationSubtype` 集成的参数。您可以提供静态值，或者在运行时评估的映射请求数据、阶段变量或上下文变量。要了解更多信息，请参阅“[针对 API Gateway 中的 HTTP API 创建 AWS 服务集成](http-api-develop-integrations-aws-services.md)”。  | 

## `x-amazon-apigateway-integration.requestParameters` 示例
<a name="api-gateway-swagger-extensions-request-parameters-example"></a>

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

**注意**  
如果您要通过 OpenAPI 或 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"
},
```

