-
Notifications
You must be signed in to change notification settings - Fork 429
Understanding of the compress option #1890
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
creating a PR for this now... hey @nilsm0hr, I've read between the lines that you didn't pass a I suspect you went from: @app.get("/todos", compress=True)
def get_todos():
return Response(200, content_types.APPLICATION_JSON, {"hello": "blah"}) To: @app.get("/todos", compress=True)
def get_todos():
return Response(200, content_types.APPLICATION_JSON, json.dumps({"hello": "blah"})) |
|
This is now released under 2.17.0 version! |
Uh oh!
There was an error while loading. Please reload this page.
Discussed in #1885
Originally posted by nilsm0hr February 1, 2023
Hi,
I tired to understand the compress option in PowerTools. We have started to implement powertools on our functions. Some of them compressed the Lambda response in our python code and returned the base64 payload to enable larger payloads.
The documentation suggests that you just return an object, rather than the Response object powertools provides. Looking at the source code, I managed to use the powertools response object after I dumped my json response to a string.
Would it be possible to make the docs a bit clearer around this? Not quite sure if I am misunderstanding something here.
https://awslabs.github.io/aws-lambda-powertools-python/2.7.1/core/event_handler/api_gateway/#compress
Thanks
The text was updated successfully, but these errors were encountered: