【发布时间】:2020-06-24 03:37:00
【问题描述】:
我有一个 API Gateway 发布请求,通过 lambda 函数将 PDF 文件上传到 S3 存储桶。 Content-Type 是 application/pdf,在它下面我定义模板为{"content":"$input.body"}。
在我的 lambda 函数中,我有:
public APIGatewayProxyResponse FunctionHandler(APIGatewayProxyRequest request, ILambdaContext context)
{
Console.WriteLine(request.Body);
return new APIGatewayProxyResponse
{
Body = request.Body,
StatusCode = 200
};
}
但是,当我在 Postman 中通过在请求正文中附加一个 PDF 文件并在 Content-Type 为 application/pdf 中对其进行测试时,在 lambda 函数中访问的请求正文始终为空。为什么?
【问题讨论】:
标签: c# .net aws-lambda aws-api-gateway