amazon-web-services - 超时时在 api 网关响应正文中返回 lambda 的 context.requestId
问题描述
使用 ApiGateway Lambda 集成时,我需要将 lambda 的上下文请求 ID 返回给客户端。我在 ApiGateway -> Gateway Responses -> Integration Timeout -> Response Templates 中试过这个
{ "message":$context.error.messageString, "request_id": $context.awsEndpointRequestId, "request_id_2": $context.requestId }
但是,响应正文中仅显示 $context.requestId,而不是 $context.awsEndpointRequestId。
如果 ApiGateway 超时, awsEndpointRequestId (我假设它是 lambda 上下文请求 id )是否不可用?
解决方案
推荐阅读
- kotlin - Kotlin REPL 算术
- ios - 在 XCode 的 Copy Files Build Phase 中保留目录结构
- typescript - OpenFL bitmapData.getPixel32 总是返回 0
- django - Django中相同实体的不同一对多关系
- numpy - 关于切片 Numpy 张量的简单问题
- java - 如何强制专注于 NumberPicker (android)?
- c - C程序未填充应由条件填充的写入文件
- c# - 从 NLog 配置中获取日志文件,而不是硬编码
- excel - 如何从字符串excel公式中提取文本不起作用
- postgresql - Google Cloud SQL 存储扩展问题