awslabs / awslabs/aws-lambda-cpp
Lambda return types through HTTP API Gateway - only json array or json object are working , else error 500
- 主要語言
- 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
貢獻指南
研究方向
從 invocation_response::success 和範例中顯示的 run_handler 路徑開始,接著追蹤回應如何針對 HTTP API Gateway 進行序列化。檢查現有的回應序列化測試是否涵蓋非 JSON payload。完成標準是為內容類型為 application/zip 的二進位資料建立並測試一種受支援的方式,使其避免 HTTP 500 回應。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- aws, cpp
- 領域
- api, cloud
- Issue 類型
- 功能
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 需要釐清
- 新手友好度
- 35/100