Joh*_*man 4 vtl amazon-web-services aws-api-gateway
我需要在API网关方法的正文映射模板中包含请求时间.有日期/时间变量或功能吗?我在模板参考中找不到任何内容.
示例正文映射模板:
Action=SendMessage&MessageBody=$util.urlEncode("{""timestamp"":""TIMESTAMP_HERE"",""body-json"":$input.json('$'),""params"":""$input.params()""}")
Run Code Online (Sandbox Code Playgroud)
更新:API 网关刚刚添加了两个新的上下文变量http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html
$context.requestTime The CLF-formatted request time (dd/MMM/yyyy:HH:mm:ss +-hhmm).
$context.requestTimeEpoch The Epoch-formatted request time.
Run Code Online (Sandbox Code Playgroud)
API 网关目前不支持此功能。之前在论坛上有人要求过 - https://forums.aws.amazon.com/thread.jspa?messageID=697658&。我们的待办事项中有此功能,但不幸的是我无法承诺任何时间表。
| 归档时间: |
|
| 查看次数: |
3774 次 |
| 最近记录: |