Aws sam local start-api with binary support

Viewed 139

I try to test a lambda function with a binary result (gzip stream).

I would like to use sam local start-api to test my API. This API return a binary result like this:

response.body = base64.b64encode("hello".encode('utf-8'))
#response.headers["Content-Encoding"] = "gzip"
response["isBase64Encoded"] = True
return response

The result see by the browser is base64 encoded (aGVsbG8=), and not a binary result (hello).

It's possible to activate the binary support in AWS console, but how it's possible to activate the binary support with sam local start-api ?

0 Answers
Related