awslabs / awslabs/aws-lambda-cpp

Lambda return types through HTTP API Gateway - only json array or json object are working , else error 500

未关闭
#118 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
C++
星标
465
派生
98
平均合并
12 小时 47 分钟
30 天内合并 PR
3

描述

I'd like to return binary data through the HTTP API Gateway (HTTP , NOT REST API!), but the response has to be a json object, always. Is there some workaround to make that happen like it is possible for the REST API ?

```
#include
using namespace aws::lambda_runtime;
static invocation_response my_handler(invocation_request const& req)
{
return invocation_response::success("binarygoeshere", "application/zip");
}

int main()
{
run_handler(my_handler);
return 0;
}
```
^this returns error code 500

贡献指南

打开贡献指南

调研方向

Start with invocation_response::success and the run_handler path shown in the example, then trace how the response is serialized for HTTP API Gateway. Check whether existing response-serialization tests cover non-JSON payloads. Done means establishing and testing a supported way for binary data with content type application/zip to avoid the HTTP 500 response.

由索引模型根据 Issue 内容生成。

评估

技术栈
aws, cpp
领域
api, cloud
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。