I created an ASP.NET Core app using a project template in AWS Toolkit. I deployed it as AWS Lambda and noticed the binary files are being base64 encoded in the responses. I added the proper media types in the AWS API Gateway as shown below. The browser is sending the proper Accept settings. The response is showing x-amzn-remapped-content-length of 3346 which is the actual file size and the response size is 4464 which is the base64 encoded version.
I have seen responses about setting "contentHandling": "CONVERT_TO_BINARY" in yml files. I am not using any yml files. The project template already is setup with using a CloudFormation template (serverless.template). I tried putting the setting in there but it errors out. Either the template doesn't understand the setting during deployment or I was putting it in the wrong place in the template file.
Any ideas on how I can get the endpoint to send binary files as is without encoding?