aws / aws/aws-lambda-runtime-interface-emulator

Support http-request with multipart/form-data.

Đang mở
#61 0 bình luận 1 reaction 0 người được giao Xem trên GitHub
enhancement
Ngôn ngữ chính
Go
Star
1.1k
Fork
118
Merge trung bình
42 phút
Pull request đã merge (30 ngày)
2

Mô tả

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’.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Start by reproducing the request against /2015-03-31/functions/function/invocations using the curl --form example in the issue, and compare it with the working JSON request. Trace the emulator's request handling from that endpoint; done means multipart/form-data requests containing messages or files are accepted without the UTF-8 unmarshal error.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
go
Lĩnh vực
api, backend
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.