Skip to content

Feature request: Support cookies in Lambda function response for format 2.0 #1192

Description

@eflopez

Use case

I am using the Router class to setup some resolvers for use with APIGatewayHttpResolver, and I would like to be able to set cookies in my customised Response object, but this is not currently possible.

According to the APIGateway response documentation, the format for this is

{
    "cookies" : ["cookie1", "cookie2"],
    "isBase64Encoded": true|false,
    "statusCode": httpStatusCode,
    "headers": { "headername": "headervalue", ... },
    "body": "Hello from Lambda!"
}

Solution/User Experience

Would be great to be able to just be able to do something like

    return Response(
        status_code=418,
        cookies=["cookie1", "cookie2"],
        content_type="application/json",
        body=payload,
        headers=custom_headers,
    )

Alternative solutions

No response

Acknowledgment

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions