I have an API Gateway post request to upload a PDF file to S3 bucket through a lambda function. The Content-Type is application/pdf, under it I define the template as {"content":"$input.body"}.
Inside my lambda function, I have:
public APIGatewayProxyResponse FunctionHandler(APIGatewayProxyRequest request, ILambdaContext context)
{
Console.WriteLine(request.Body);
return new APIGatewayProxyResponse
{
Body = request.Body,
StatusCode = 200
};
}
However when I test it in Postman by attaching a PDF file in the request body with the Content-Type as application/pdf, the request body accessed within the lambda function is always empty. Why?