AWS Chalice Return an Image File from S3

别等时光非礼了梦想. 提交于 2019-12-06 22:26:37

There was a bug in Chalice that was fixed on 14-May-2019:

https://github.com/aws/chalice/issues/1095

I had a similar problem to yours and it's been fixed by grabbing the latest version of Chalice.

Make sure the ContentHandling attribute of the IntegrationResponse is set to CONVERT_TO_BINARY. In the AWS console, navigate to the IntegrationResponse page for your binary method(s) and choose "Convert to binary (if needed)".

If you're comfortable with the CLI, you could also use a command like the following.

aws apigateway update-integration-response --rest-api-id foobar 
    --resource-id barfoo --http-method GET --status-code 200 
    --patch-operations op='replace',path='/contentHandling',value='CONVERT_TO_BINARY'
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!