aws / aws/aws-lambda-runtime-interface-emulator
Support http-request with multipart/form-data.
- 主要语言
- Go
- 星标
- 1.1k
- 派生
- 118
- 平均合并
- 42 分钟
- 30 天内合并 PR
- 2
描述
When sending http-request using curl or postman with content-type as ‘application/json’, it is working well.
`curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{[body with json]}'`
But with content-type as ‘multipart/form-data’, it is not working with error about “unmarshal input : ‘utf-8’”
`curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" --form '[some message or file]'`
Error log
`START RequestId: 869477bd-4c63-4d81-802c-416e9634067b Version: $LATEST
Traceback (most recent call last):able to unmarshal input: 'utf-8' codec can't decode byte 0xb9 in position 451: invalid start byte
END RequestId: 869477bd-4c63-4d81-802c-416e9634067b
REPORT RequestId: 869477bd-4c63-4d81-802c-416e9634067b Duration: 20.28 ms Billed Duration: 100 ms Memory Size: 3008 MB Max Memory Used: 3008 MB`
It need to support content-type as ‘multipart/form-data’. I wonder it is possible or only support ‘application/json’.
贡献指南
调研方向
首先,使用 issue 中的 curl --form 示例复现对 /2015-03-31/functions/function/invocations 的请求,并将其与正常工作的 JSON 请求进行比较。从该 endpoint 开始跟踪 emulator 的请求处理流程;当包含 messages 或 files 的 multipart/form-data 请求能够被接受且不再出现 UTF-8 unmarshal 错误时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- go
- 领域
- api, backend
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100